3 test_description='server post-receive email notification and how it behaves in our stable-based envrionment'
7 export USER_EMAIL=author@example.com
9 test_expect_success 'setup' '
14 git commit -m "setup" &&
15 git clone -l . --bare server.git &&
16 rm -fr server.git/hooks &&
17 git remote add origin ./server.git &&
18 git config branch.master.remote origin &&
19 git config branch.master.merge refs/heads/master &&
20 GIT_DIR=./server.git git config hooks.post-receive-email.mailinglist commits@list.com &&
21 GIT_DIR=./server.git git config hooks.post-receive-email.debug true &&
22 echo cbas >./server.git/description &&
24 git checkout -b stable &&
25 git push origin stable
28 install_post_receive_hook 'post-receive-email'
30 test_expect_success 'conflict diff' '
31 git checkout stable &&
35 git commit -a -m "lines" &&
36 git push origin stable &&
38 git checkout -b topic1 stable &&
39 echo "line1.topic1" >a &&
40 echo "line2.topic1" >>a &&
41 echo "line3.topic1" >>a &&
42 git commit -a -m "lines changed on topic1" &&
43 git push origin topic1 &&
45 old_commit_hash=$(git rev-parse HEAD) &&
46 old_commit_abbrev=$(git rev-parse --short HEAD) &&
49 git checkout stable &&
50 echo "line1.stable" >a &&
51 echo "line2.stable" >>a &&
52 echo "line3.stable" >>a &&
53 git commit -a -m "lines changed on stable" &&
54 git push origin stable &&
56 stable_abbrev=$(git rev-parse --short HEAD) &&
58 git checkout topic1 &&
61 echo "line1.topic" >a &&
62 echo "line2.stable" >>a &&
63 echo "line3.resolved" >>a &&
65 git commit -a -m "resolved lines for merging stable into topic1" &&
66 second_stable_hash=$(git rev-parse HEAD) &&
67 git push origin topic1 &&
69 new_commit_hash=$(git rev-parse HEAD) &&
70 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
71 new_commit_abbrev=$(git rev-parse --short HEAD) &&
73 interpolate ../t2204-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date stable_abbrev &&
74 test_cmp 1.txt server.git/refs.heads.topic1.out