Skip to content

Commit 4ce2b51

Browse files
felipecgitster
authored andcommitted
completion: zsh: fix __gitcomp_direct()
Many callers append a space suffix, but zsh automatically appends a space, making the completion add two spaces, for example: git log ma<tab> Will complete 'master '. Let's remove that extra space. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1d1c4a8 commit 4ce2b51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3498,7 +3498,7 @@ if [[ -n ${ZSH_VERSION-} ]] &&
34983498

34993499
local IFS=$'\n'
35003500
compset -P '*[=:]'
3501-
compadd -Q -- ${=1} && _ret=0
3501+
compadd -Q -- ${${=1}% } && _ret=0
35023502
}
35033503

35043504
__gitcomp_nl ()

contrib/completion/git-completion.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ __gitcomp_direct ()
7474

7575
local IFS=$'\n'
7676
compset -P '*[=:]'
77-
compadd -Q -- ${=1} && _ret=0
77+
compadd -Q -- ${${=1}% } && _ret=0
7878
}
7979

8080
__gitcomp_nl ()

0 commit comments

Comments
 (0)