Skip to content

Commit bf8ae49

Browse files
felipecgitster
authored andcommitted
completion: bash: fix prefix detection in branch.*
Otherwise we are completely ignoring the --cur argument. The issue can be tested with: git clone --config=branch.<tab> Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com> Tested-by: David Aguilar <davvid@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ebf3c04 commit bf8ae49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,8 +2649,8 @@ __git_complete_config_variable_name ()
26492649
return
26502650
;;
26512651
branch.*)
2652-
local pfx="${cur%.*}."
2653-
cur_="${cur#*.}"
2652+
local pfx="${cur_%.*}."
2653+
cur_="${cur_#*.}"
26542654
__gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
26552655
__gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx"
26562656
return

0 commit comments

Comments
 (0)