diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2021-08-16 04:10:22 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-18 11:17:25 -0700 |
commit | bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231 (patch) | |
tree | 5fb725e92a5318de7077fff14289463cd3b99c0f /contrib | |
parent | ebf3c04b262aa27fbb97f8a0156c2347fecafafb (diff) | |
download | git-bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231.tar.gz |
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>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/completion/git-completion.bash | 4 |
1 files changed, 2 insertions, 2 deletions
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 |