diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-05-21 04:02:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-21 04:02:22 -0700 |
commit | 42779124a2f158583f89d23dec78266ea3471103 (patch) | |
tree | ec746071f8558ca209ffe8b21f93446eccabdd05 /t | |
parent | 4cbf42e1519015a30401992815331c048ff3c982 (diff) | |
parent | 111fb858654b95355da05772b4dcdf91decc4721 (diff) | |
download | git-42779124a2f158583f89d23dec78266ea3471103.tar.gz |
Merge branch 'st/remote-tags-no-tags'
* st/remote-tags-no-tags:
remote add: add a --[no-]tags option
Honor "tagopt = --tags" configuration option
Diffstat (limited to 't')
-rwxr-xr-x | t/t5505-remote.sh | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 230c0cd784..41f17e7693 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -320,6 +320,69 @@ test_expect_success 'add alt && prune' ' git rev-parse --verify refs/remotes/origin/side2) ' +cat >test/expect <<\EOF +some-tag +EOF + +test_expect_success 'add with reachable tags (default)' ' + (cd one && + >foobar && + git add foobar && + git commit -m "Foobar" && + git tag -a -m "Foobar tag" foobar-tag && + git reset --hard HEAD~1 && + git tag -a -m "Some tag" some-tag) && + (mkdir add-tags && + cd add-tags && + git init && + git remote add -f origin ../one && + git tag -l some-tag >../test/output && + git tag -l foobar-tag >>../test/output && + test_must_fail git config remote.origin.tagopt) && + test_cmp test/expect test/output +' + +cat >test/expect <<\EOF +some-tag +foobar-tag +--tags +EOF + +test_expect_success 'add --tags' ' + (rm -rf add-tags && + mkdir add-tags && + cd add-tags && + git init && + git remote add -f --tags origin ../one && + git tag -l some-tag >../test/output && + git tag -l foobar-tag >>../test/output && + git config remote.origin.tagopt >>../test/output) && + test_cmp test/expect test/output +' + +cat >test/expect <<\EOF +--no-tags +EOF + +test_expect_success 'add --no-tags' ' + (rm -rf add-tags && + mkdir add-no-tags && + cd add-no-tags && + git init && + git remote add -f --no-tags origin ../one && + git tag -l some-tag >../test/output && + git tag -l foobar-tag >../test/output && + git config remote.origin.tagopt >>../test/output) && + (cd one && + git tag -d some-tag foobar-tag) && + test_cmp test/expect test/output +' + +test_expect_success 'reject --no-no-tags' ' + (cd add-no-tags && + test_must_fail git remote add -f --no-no-tags neworigin ../one) +' + cat > one/expect << EOF apis/master apis/side |