summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-26 06:39:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-26 06:39:09 (GMT)
commitf70b54118897ffaa768ac48c9dabec36b293d09a (patch)
tree946225ca233c017e0206fdf9f69cba891b6ded25 /t
parent3961c516990e99f648981918a95ab77bde5a0f37 (diff)
parent723c1d526faaee6fac9b804f4b97b148f450eb5d (diff)
downloadgit-f70b54118897ffaa768ac48c9dabec36b293d09a.zip
git-f70b54118897ffaa768ac48c9dabec36b293d09a.tar.gz
git-f70b54118897ffaa768ac48c9dabec36b293d09a.tar.bz2
Merge branch 'ab/completion-push-delete-ref'
The completion script (in contrib/) learned to complete "git push --delete b<TAB>" to complete branch name to be deleted. * ab/completion-push-delete-ref: completion: expand "push --delete <remote> <ref>" for refs on that <remote>
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 5ed2813..2cb999e 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1457,4 +1457,38 @@ test_expect_failure 'complete with tilde expansion' '
test_completion "git add ~/tmp/" "~/tmp/file"
'
+test_expect_success 'setup other remote for remote reference completion' '
+ git remote add other otherrepo &&
+ git fetch other
+'
+
+for flag in -d --delete
+do
+ test_expect_success "__git_complete_remote_or_refspec - push $flag other" '
+ sed -e "s/Z$//" >expected <<-EOF &&
+ master-in-other Z
+ EOF
+ (
+ words=(git push '$flag' other ma) &&
+ cword=${#words[@]} cur=${words[cword-1]} &&
+ __git_complete_remote_or_refspec &&
+ print_comp
+ ) &&
+ test_cmp expected out
+ '
+
+ test_expect_failure "__git_complete_remote_or_refspec - push other $flag" '
+ sed -e "s/Z$//" >expected <<-EOF &&
+ master-in-other Z
+ EOF
+ (
+ words=(git push other '$flag' ma) &&
+ cword=${#words[@]} cur=${words[cword-1]} &&
+ __git_complete_remote_or_refspec &&
+ print_comp
+ ) &&
+ test_cmp expected out
+ '
+done
+
test_done