diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2020-11-10 05:03:42 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-10 05:09:21 +0300 |
commit | 9414938c348f47c76dcea7826ea0b22adb585300 (patch) | |
tree | 97284598bbf3e3350d51b0364b7c0b82e8c8ba39 /t | |
parent | e4d83eee9239207622e2b1cc43967da5051c189c (diff) |
completion: bash: support recursive aliases
It is possible to have recursive aliases like:
l = log --oneline
lg = l --graph
So the completion should detect such aliases as well.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t9902-completion.sh | 19 |
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 |