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 'merge in stable' '
32 git checkout -b topic1 stable &&
33 echo "move" >a.topic1 &&
35 git commit -a -m "move topic1" &&
36 git push origin topic1 &&
37 old_commit_hash=$(git rev-parse HEAD) &&
38 old_commit_abbrev=$(git rev-parse --short HEAD) &&
41 git checkout stable &&
42 echo "$test_name 1" >a &&
43 echo "$test_name 1" >b &&
44 echo "$test_name 1" >c &&
45 git commit -a -m "move stable 1" &&
46 first_stable_hash=$(git rev-parse HEAD) &&
48 echo "$test_name 2" >a &&
49 echo "$test_name 2" >b &&
50 echo "$test_name 2" >c &&
51 git commit -a -m "move stable 2" &&
52 second_stable_hash=$(git rev-parse HEAD) &&
53 git push origin stable &&
56 git checkout topic1 &&
60 new_commit_hash=$(git rev-parse HEAD) &&
61 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
62 new_commit_abbrev=$(git rev-parse --short HEAD) &&
64 interpolate ../t2203-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date first_stable_hash second_stable_hash &&
65 test_cmp 1.txt server/.git/refs.heads.topic1.out
68 test_expect_success 'merge in stable with conflict' '
69 git checkout topic1 &&
70 echo "$test_name on topic1" >a &&
71 git commit -a -m "move topic1" &&
72 git push origin topic1 &&
73 old_commit_hash=$(git rev-parse HEAD) &&
74 old_commit_abbrev=$(git rev-parse --short HEAD) &&
77 git checkout stable &&
78 echo "$test_name 1" >a &&
79 echo "$test_name 1" >b &&
80 echo "$test_name 1" >c &&
81 git commit -a -m "move stable 1" &&
82 first_stable_hash=$(git rev-parse HEAD) &&
84 echo "$test_name 2" >a &&
85 echo "$test_name 2" >b &&
86 echo "$test_name 2" >c &&
87 git commit -a -m "move stable 2" &&
88 second_stable_hash=$(git rev-parse HEAD) &&
89 git push origin stable &&
92 git checkout topic1 &&
94 echo "$test_name 2 merged topic1" >a &&
96 git commit -F .git/MERGE_MSG
99 new_commit_hash=$(git rev-parse HEAD) &&
100 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
101 new_commit_abbrev=$(git rev-parse --short HEAD) &&
103 interpolate ../t2203-2.txt 2.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_abbrev new_commit_date first_stable_hash second_stable_hash &&
104 test_cmp 2.txt server/.git/refs.heads.topic1.out