summaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-10-17 00:03:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-19 22:07:06 (GMT)
commit458a7e508c57afb6bbd4177fead21c63a0a20131 (patch)
treeea3f56279c025288d7b4675c9450c18ec52d83a5 /t/t5516-fetch-push.sh
parent207394908e9465d0169608725aeaa5bb355086e0 (diff)
downloadgit-458a7e508c57afb6bbd4177fead21c63a0a20131.zip
git-458a7e508c57afb6bbd4177fead21c63a0a20131.tar.gz
git-458a7e508c57afb6bbd4177fead21c63a0a20131.tar.bz2
t5516: test pushing a tag of an otherwise unreferenced blob
It's not unreasonable to have a tag that points to a blob that is not part of the normal history. We do this in git.git to distribute gpg keys. However, we never explicitly checked in our test suite that this actually works (i.e., that pack-objects actually sends the blob because of the tag mentioning it). It does in fact work fine, but a recent patch under discussion broke this, and the test suite didn't notice. Let's make the test suite more complete. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 67e0ab3..7c8a769 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1277,4 +1277,17 @@ EOF
git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo
'
+test_expect_success 'pushing a tag pushes the tagged object' '
+ rm -rf dst.git &&
+ blob=$(echo unreferenced | git hash-object -w --stdin) &&
+ git tag -m foo tag-of-blob $blob &&
+ git init --bare dst.git &&
+ git push dst.git tag-of-blob &&
+ # the receiving index-pack should have noticed
+ # any problems, but we double check
+ echo unreferenced >expect &&
+ git --git-dir=dst.git cat-file blob tag-of-blob >actual &&
+ test_cmp expect actual
+'
+
test_done