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>

Felipe Contreras committed Aug 16, 2021 at 04:10 UTC bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231
1 file changed +2 -2
contrib/completion/git-completion.bash
+2 -2
@@ -2649,8 +2649,8 @@ __git_complete_config_variable_name ()
2649 return
2650 ;;
2651 branch.*)
2652 - local pfx="${cur%.*}."
2653 - cur_="${cur#*.}"
2652 + local pfx="${cur_%.*}."
2653 + cur_="${cur_#*.}"
2654 __gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
2655 __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx"
2656 return