From: Felipe Contreras Date: Mon, 16 Aug 2021 09:10:22 +0000 (-0500) Subject: completion: bash: fix prefix detection in branch.* X-Git-Tag: v2.33.1~70^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231;p=thirdparty%2Fgit.git 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. Reviewed-by: SZEDER Gábor Tested-by: David Aguilar Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index b50c5d0ea3..47b48fbab6 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2649,8 +2649,8 @@ __git_complete_config_variable_name () return ;; branch.*) - local pfx="${cur%.*}." - cur_="${cur#*.}" + local pfx="${cur_%.*}." + cur_="${cur_#*.}" __gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")" __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx" return