summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2021-08-16 09:10:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-18 18:17:25 (GMT)
commitbf8ae49a8f7d8b6dd87bbea34e6566e8581ab231 (patch)
tree5fb725e92a5318de7077fff14289463cd3b99c0f /contrib/completion
parentebf3c04b262aa27fbb97f8a0156c2347fecafafb (diff)
downloadgit-bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231.zip
git-bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231.tar.gz
git-bf8ae49a8f7d8b6dd87bbea34e6566e8581ab231.tar.bz2
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/completion')
-rw-r--r--contrib/completion/git-completion.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b50c5d0..47b48fb 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