3 test_description='server post-receive email notification'
7 test_expect_success 'setup' '
10 git commit -m "setup" &&
11 git clone ./. server &&
12 rm -fr server/.git/hooks &&
13 git remote add origin ./server &&
14 git config --add branch.master.remote origin &&
15 git config --add branch.master.merge refs/heads/master &&
16 GIT_DIR=./server/.git git config --add hooks.mailinglist commits@list.com &&
17 GIT_DIR=./server/.git git config --add hooks.debug true &&
19 echo cbas >./server/.git/description
22 install_server_hook 'post-receive-email' 'post-receive'
24 test_expect_success 'create branch' '
25 git checkout -b topic master &&
26 echo "$test_name" >a &&
27 git commit -a -m "$test_name on topic" &&
28 prior_commit_hash=$(git rev-parse HEAD) &&
29 prior_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
31 echo "$test_name 2" >a &&
32 git commit -a -m "$test_name on topic 2 " &&
33 new_commit_hash=$(git rev-parse HEAD) &&
34 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
36 git push origin topic &&
38 interpolate ../t2202-1.txt 1.txt new_commit_hash new_commit_date prior_commit_hash prior_commit_date &&
39 test_cmp 1.txt server/.git/refs.heads.topic.out
42 test_expect_success 'delete branch' '
43 old_commit_hash=$(git rev-parse HEAD) &&
44 git push origin :refs/heads/topic &&
46 interpolate ../t2202-2.txt 2.txt old_commit_hash &&
47 test_cmp 2.txt server/.git/refs.heads.topic.out