3 test_description='server post-receive email notification and how it behaves in our stable-based envrionment'
9 test_expect_success 'setup' '
14 git commit -m "setup" &&
15 git clone ./. server &&
16 rm -fr server/.git/hooks &&
17 git remote add origin ./server &&
18 git config --add branch.master.remote origin &&
19 git config --add branch.master.merge refs/heads/master &&
20 GIT_DIR=./server/.git git config --add hooks.post-receive-email.mailinglist commits@list.com &&
21 GIT_DIR=./server/.git git config --add hooks.post-receive-email.debug true &&
23 echo cbas >./server/.git/description &&
25 git checkout -b stable &&
26 git push origin stable
29 install_post_receive_hook 'post-receive-email'
31 test_expect_success 'conflict diff' '
32 git checkout stable &&
36 git commit -a -m "lines" &&
37 git push origin stable &&
39 git checkout -b topic1 stable &&
40 echo "line1.topic1" >a &&
41 echo "line2.topic1" >>a &&
42 echo "line3.topic1" >>a &&
43 git commit -a -m "lines changed on topic1" &&
44 git push origin topic1 &&
46 old_commit_hash=$(git rev-parse HEAD) &&
47 old_commit_abbrev=$(git rev-parse --short HEAD) &&
50 git checkout stable &&
51 echo "line1.stable" >a &&
52 echo "line2.stable" >>a &&
53 echo "line3.stable" >>a &&
54 git commit -a -m "lines changed on stable" &&
55 git push origin stable &&
57 stable_hash=$(git rev-parse HEAD) &&
59 git checkout topic1 &&
62 echo "line1.topic" >a &&
63 echo "line2.stable" >>a &&
64 echo "line3.resolved" >>a &&
66 git commit -a -m "resolved lines for merging stable into topic1" &&
67 second_stable_hash=$(git rev-parse HEAD) &&
68 git push origin topic1 &&
70 new_commit_hash=$(git rev-parse HEAD) &&
71 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
72 new_commit_abbrev=$(git rev-parse --short HEAD) &&
74 interpolate ../t2204-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date stable_hash &&
75 test_cmp 1.txt server/.git/refs.heads.topic1.out