diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-25 23:23:27 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-25 23:23:27 +0400 |
commit | af6ba0eb9e7d39df135e818fc98629dec473306c (patch) | |
tree | 4ceb9b813db2d4878b7904b2312936384e14e81d /t | |
parent | 2a20f4b7e298891c9f02eb924ec9ddf4c35ae8ce (diff) | |
parent | 56f24e80f0af4dd3591c8f143183b59cf9a34620 (diff) |
Merge branch 'sp/complete-ext-alias'
* sp/complete-ext-alias:
completion: handle '!f() { ... }; f' and "!sh -c '...' -" aliases
Diffstat (limited to 't')
-rwxr-xr-x | t/t9902-completion.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 2d4beb5e50..1d1c1063a3 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -550,6 +550,33 @@ test_expect_success 'complete files' ' test_completion "git add mom" "momified" ' +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 + master Z + mybranch Z + mytag Z + EOF +' + +test_expect_success 'completion uses <cmd> completion for alias: !f () { VAR=val git <cmd> ... }' ' + test_config alias.co "!f () { VAR=val git checkout ... ; } f" && + test_completion "git co m" <<-\EOF + master Z + mybranch Z + mytag Z + EOF +' + +test_expect_success 'completion used <cmd> completion for alias: !f() { : git <cmd> ; ... }' ' + test_config alias.co "!f() { : git checkout ; if ... } f" && + test_completion "git co m" <<-\EOF + master Z + mybranch Z + mytag Z + EOF +' + test_expect_failure 'complete with tilde expansion' ' git init tmp && cd tmp && test_when_finished "cd .. && rm -rf tmp" && |