diff mbox series

[31/51] completion: bash: change suffix check in __gitcomp

Message ID 20220830093138.1581538-32-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show
Series completion: revamp | expand

Commit Message

Felipe Contreras Aug. 30, 2022, 9:31 a.m. UTC
We don't match the prefix, we shouldn't match the suffix either.

There are no functional changes since all the callers that add a suffix
add an =, and if $cur_ ended with that suffix, we would return
immediately.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c9315d4f9a..2ff7de1274 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -351,8 +351,8 @@  __gitcomp ()
 			fi
 			break
 		fi
-		c="$c${4-}"
 		if [[ $c == "$cur_"* ]]; then
+			c="$c${4-}"
 			case $c in
 			*=|*.) ;;
 			*) c="$c " ;;