From: Felipe Contreras Date: Mon, 16 Aug 2021 09:10:22 GMT Subject: [PATCH v3 try4 1/4] completion: bash: fix prefix detection in branch.* Message-ID: <20210816091025.548095-2-felipe.contreras@gmail.com> In-Reply-To: <20210816091025.548095-1-felipe.contreras@gmail.com> 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 --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 4bdd27ddc8..6bcf97ce79 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2650,8 +2650,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 -- 2.32.0.48.g096519100f