Fix post-receive-email test for USER_EMAIL variable.
[git-central.git] / tests / t3000-server-post-receive-trac.sh
index 8468b57..bdb783e 100644 (file)
@@ -5,7 +5,6 @@ test_description='server update lock check'
 . ./test-lib.sh
 
 export PYTHON=echo
-export POST_RECEIVE_TRAC=/foo/post-receive-trac.py
 export TRAC_ENV=/foo/trac
 
 test_expect_success 'setup' '
@@ -25,14 +24,14 @@ test_expect_success 'new branch' '
        git commit -a -m "changed on topic1" &&
        new_commit_hash=$(git rev-parse HEAD) &&
        git push origin topic1 2>push.err &&
-       cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $new_commit_hash $new_commit_hash"
+       cat push.err | grep "/foo/trac topic1 $new_commit_hash $new_commit_hash $new_commit_hash"
 '
 
 test_expect_success 'new branch with already existing does not double tap' '
        git checkout -b topic2 topic1 &&
        existing_commit_hash=$(git rev-parse HEAD) &&
        git push origin topic2 2>push.err &&
-       ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $existing_commit_hash $existing_commit_hash"
+       ! cat push.err | grep "/foo/trac topic2"
 '
 
 test_expect_success 'update branch' '
@@ -41,7 +40,7 @@ test_expect_success 'update branch' '
        git commit -a -m "changed on topic2" &&
        new_commit_hash=$(git rev-parse HEAD) &&
        git push origin topic2 2>push.err &&
-       cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $new_commit_hash $new_commit_hash"
+       cat push.err | grep "/foo/trac topic2 $new_commit_hash $new_commit_hash $new_commit_hash"
 '
 
 test_expect_success 'update branch to an already published commit does not double tap' '
@@ -55,8 +54,8 @@ test_expect_success 'update branch to an already published commit does not doubl
 
        git push 2>push.err &&
 
-       ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $topic2_hash $topic2_hash"
-       ! cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic1 $topic1_hash $topic1_hash"
+       ! cat push.err | grep "/foo/trac topic2"
+       ! cat push.err | grep "/foo/trac topic1"
 '
 
 test_expect_success 'update branch with abbreviation' '
@@ -69,7 +68,23 @@ test_expect_success 'update branch with abbreviation' '
        new_commit_describe=$(git describe HEAD) &&
        new_commit_hash=$(git rev-parse HEAD) &&
        git push origin topic2 2>push.err &&
-       cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $new_commit_describe $new_commit_hash"
+       cat push.err | grep "/foo/trac topic2 $new_commit_describe $new_commit_describe $new_commit_hash"
+'
+
+test_expect_success 'update branch with abbreviation and two commits' '
+       echo "$test_name 1" >a &&
+       git commit -a -m "changed on topic2 1" &&
+       first_commit_describe=$(git describe HEAD) &&
+       first_commit_hash=$(git rev-parse HEAD) &&
+
+       echo "$test_name 2" >a &&
+       git commit -a -m "changed on topic2 2" &&
+       second_commit_describe=$(git describe HEAD) &&
+       second_commit_hash=$(git rev-parse HEAD) &&
+
+       git push origin topic2 2>push.err &&
+       cat push.err | grep "/foo/trac topic2 $first_commit_describe $first_commit_describe $first_commit_hash" &&
+       cat push.err | grep "/foo/trac topic2 $second_commit_describe $second_commit_describe $second_commit_hash"
 '
 
 test_done