Test making a lightweight tag.
authorStephen Haberman <stephen@exigencecorp.com>
Thu, 21 Aug 2008 03:57:03 +0000 (22:57 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Thu, 21 Aug 2008 03:57:03 +0000 (22:57 -0500)
tests/t2201-4.txt [new file with mode: 0644]
tests/t2201-server-post-receive-email-tags.sh

diff --git a/tests/t2201-4.txt b/tests/t2201-4.txt
new file mode 100644 (file)
index 0000000..8b07459
--- /dev/null
@@ -0,0 +1,23 @@
+From: author@payflex.com
+To: commits@list.com
+Subject: [cbas] 2.1 tag created. $new_commit_describe
+X-Git-Refname: refs/tags/2.1
+X-Git-Reftype: tag
+X-Git-Oldrev: 0000000000000000000000000000000000000000
+X-Git-Newrev: $new_commit_hash
+
+The tag, 2.1 has been created
+        at  $new_commit_hash (commit)
+
+- Log -----------------------------------------------------------------
+commit $new_commit_hash
+Author: A U Thor <author@example.com>
+Date:   $new_commit_date
+
+    create lightweight tag
+-----------------------------------------------------------------------
+
+
+hooks/post-receive
+--
+cbas
index c7622ae..bcd23cd 100644 (file)
@@ -63,5 +63,20 @@ test_expect_success 'retag branch' '
        test_cmp 3.txt server/.git/refs.tags.2.0.out
 '
 
+test_expect_success 'create lightweight tag' '
+       echo "$test_name" >a &&
+       git commit -a -m "$test_name" &&
+    git push &&
+
+       git tag 2.1 &&
+       git push --tags &&
+       new_commit_hash=$(git rev-parse HEAD) &&
+       new_commit_describe=$(git describe HEAD) &&
+       new_commit_date=$(git rev-list --no-walk --pretty=format:%ad HEAD | tail -n 1) &&
+
+       interpolate ../t2201-4.txt 4.txt new_commit_hash new_commit_describe new_commit_date &&
+       test_cmp 4.txt server/.git/refs.tags.2.1.out
+'
+
 test_done