summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 15:24:51 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 15:24:51 -0800
commitfd6445a0b8346d0dea6482af682f2116229f6436 (patch)
tree4181e14dc8acb7dc859b53e2eaa88d30ec313ca7 /t
parentSeventh batch (diff)
parentcompletion: bash: improve alias loop detection (diff)
downloadtgif-fd6445a0b8346d0dea6482af682f2116229f6436.tar.xz
Merge branch 'fc/bash-completion-alias-of-alias'
The command line completion script (in contrib/) learned to expand commands that are alias of alias. * fc/bash-completion-alias-of-alias: completion: bash: improve alias loop detection completion: bash: check for alias loop completion: bash: support recursive aliases
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 2be9190425..5c01c75d40 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -2195,6 +2195,25 @@ test_expect_success 'complete files' '
test_completion "git add mom" "momified"
'
+test_expect_success "simple alias" '
+ test_config alias.co checkout &&
+ test_completion "git co m" <<-\EOF
+ master Z
+ mybranch Z
+ mytag Z
+ EOF
+'
+
+test_expect_success "recursive alias" '
+ test_config alias.co checkout &&
+ test_config alias.cod "co --detached" &&
+ test_completion "git cod m" <<-\EOF
+ master Z
+ mybranch Z
+ mytag Z
+ EOF
+'
+
test_expect_success "completion uses <cmd> completion for alias: !sh -c 'git <cmd> ...'" '
test_config alias.co "!sh -c '"'"'git checkout ...'"'"'" &&
test_completion "git co m" <<-\EOF