]> git.99rst.org Git - git.git/commit
completion: fix incorrect bash/zsh string equality check
authorRobert Estelle <redacted>
Mon, 25 Oct 2021 22:29:33 +0000 (22:29 +0000)
committerJunio C Hamano <redacted>
Thu, 28 Oct 2021 16:33:19 +0000 (09:33 -0700)
commit46b05852863a532a897f09a8461586f3d2d38693
treeaeb8b6db6bec503b46f3282ad90a1844b84dda48
parentaf6d1d602a8f64164b266364339c4e936d5bbc33
completion: fix incorrect bash/zsh string equality check

In the basic `[`/`test` command, the string equality operator is a
single `=`. The `==` operator is only available in `[[`, which is a
bash-ism also supported by zsh.

This mix-up was causing the following completion error in zsh:
> __git_ls_files_helper:7: = not found

(That message refers to the extraneous symbol in `==` ← `=`).

This updates that comparison to use a single `=` inside the
basic `[ … ]` test conditional.

Although this fix is inconsistent with the other comparisons in this
file, which use `[[ … == … ]]`, and the two expressions are functionally
identical in this context, that approach was rejected due to a
preference for `[`.

Signed-off-by: Robert Estelle <redacted>
Signed-off-by: Junio C Hamano <redacted>
contrib/completion/git-completion.bash
git clone https://git.99rst.org/PROJECT