#
# The email subject will contain the best description of the ref that we can build from the parameters
function set_describe() {
- describe=$(git describe $rev 2>/dev/null)
+ rev_to_describe="$rev"
+ if [ "$1" != "" ] ; then
+ rev_to_describe="$1"
+ fi
+
+ describe=$(git describe $rev_to_describe 2>/dev/null)
if [ -z "$describe" ]; then
- describe=$rev
+ describe=$rev_to_describe
fi
}
cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $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/post-receive-trac.py /foo/trac topic2 $first_commit_describe $first_commit_hash" &&
+ cat push.err | grep "/foo/post-receive-trac.py /foo/trac topic2 $second_commit_describe $second_commit_hash"
+'
+
test_done