diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-03-25 14:00:40 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-25 14:00:41 -0700 |
commit | 55f6fbef3d3910fbc5de87f81e8e8e882d3d1d38 (patch) | |
tree | 02db41e2c308c62a2b8bcc01f1849fef08571214 /t | |
parent | Merge branch 'jc/maint-reflog-expire-clean-mark-typofix' (diff) | |
parent | push: --follow-tags (diff) | |
download | tgif-55f6fbef3d3910fbc5de87f81e8e8e882d3d1d38.tar.xz |
Merge branch 'jc/push-follow-tag'
The new "--follow-tags" option tells "git push" to push relevant
annotated tags when pushing branches out.
* jc/push-follow-tag:
push: --follow-tags
commit.c: use clear_commit_marks_many() in in_merge_bases_many()
commit.c: add in_merge_bases_many()
commit.c: add clear_commit_marks_many()
Diffstat (limited to 't')
-rwxr-xr-x | t/t5516-fetch-push.sh | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 6fd125aecf..d3dc5df7b1 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1077,4 +1077,77 @@ test_expect_success 'fetch exact SHA1' ' ) ' +test_expect_success 'fetch follows tags by default' ' + mk_test heads/master && + rm -fr src dst && + git init src && + ( + cd src && + git pull ../testrepo master && + git tag -m "annotated" tag && + git for-each-ref >tmp1 && + ( + cat tmp1 + sed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1 + ) | + sort -k 3 >../expect + ) && + git init dst && + ( + cd dst && + git remote add origin ../src && + git config branch.master.remote origin && + git config branch.master.merge refs/heads/master && + git pull && + git for-each-ref >../actual + ) && + test_cmp expect actual +' + +test_expect_success 'push does not follow tags by default' ' + mk_test heads/master && + rm -fr src dst && + git init src && + git init --bare dst && + ( + cd src && + git pull ../testrepo master && + git tag -m "annotated" tag && + git checkout -b another && + git commit --allow-empty -m "future commit" && + git tag -m "future" future && + git checkout master && + git for-each-ref refs/heads/master >../expect && + git push ../dst master + ) && + ( + cd dst && + git for-each-ref >../actual + ) && + test_cmp expect actual +' + +test_expect_success 'push --follow-tag only pushes relevant tags' ' + mk_test heads/master && + rm -fr src dst && + git init src && + git init --bare dst && + ( + cd src && + git pull ../testrepo master && + git tag -m "annotated" tag && + git checkout -b another && + git commit --allow-empty -m "future commit" && + git tag -m "future" future && + git checkout master && + git for-each-ref refs/heads/master refs/tags/tag >../expect + git push --follow-tag ../dst master + ) && + ( + cd dst && + git for-each-ref >../actual + ) && + test_cmp expect actual +' + test_done |