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 ./. server &&
16 rm -fr server/.git/hooks &&
17 git remote add origin ./server &&
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 'merge in stable' '
31 git checkout -b topic1 stable &&
32 echo "move" >a.topic1 &&
34 git commit -a -m "move topic1" &&
35 git push origin topic1 &&
36 old_commit_hash=$(git rev-parse HEAD) &&
37 old_commit_abbrev=$(git rev-parse --short HEAD) &&
40 git checkout stable &&
41 echo "$test_name 1" >a &&
42 echo "$test_name 1" >b &&
43 echo "$test_name 1" >c &&
44 git commit -a -m "move stable 1" &&
45 first_stable_hash=$(git rev-parse HEAD) &&
47 echo "$test_name 2" >a &&
48 echo "$test_name 2" >b &&
49 echo "$test_name 2" >c &&
50 git commit -a -m "move stable 2" &&
51 second_stable_hash=$(git rev-parse HEAD) &&
52 git push origin stable &&
55 git checkout topic1 &&
59 new_commit_hash=$(git rev-parse HEAD) &&
60 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
61 new_commit_abbrev=$(git rev-parse --short HEAD) &&
63 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 &&
64 test_cmp 1.txt server/.git/refs.heads.topic1.out
67 test_expect_success 'merge in stable with conflict' '
68 git checkout topic1 &&
69 echo "$test_name on topic1" >a &&
70 git commit -a -m "move topic1" &&
71 git push origin topic1 &&
72 old_commit_hash=$(git rev-parse HEAD) &&
73 old_commit_abbrev=$(git rev-parse --short HEAD) &&
76 git checkout stable &&
77 echo "$test_name 1" >a &&
78 echo "$test_name 1" >b &&
79 echo "$test_name 1" >c &&
80 git commit -a -m "move stable 1" &&
81 first_stable_hash=$(git rev-parse HEAD) &&
83 echo "$test_name 2" >a &&
84 echo "$test_name 2" >b &&
85 echo "$test_name 2" >c &&
86 git commit -a -m "move stable 2" &&
87 second_stable_hash=$(git rev-parse HEAD) &&
88 git push origin stable &&
91 git checkout topic1 &&
93 echo "$test_name 2 merged topic1" >a &&
95 git commit -F .git/MERGE_MSG
98 new_commit_hash=$(git rev-parse HEAD) &&
99 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
100 new_commit_abbrev=$(git rev-parse --short HEAD) &&
102 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 &&
103 test_cmp 2.txt server/.git/refs.heads.topic1.out