3 test_description='server post-receive email notification'
7 export USER_EMAIL=author@example.com
9 test_expect_success 'setup' '
12 git commit -m "setup" &&
13 git clone ./. server &&
14 rm -fr server/.git/hooks &&
15 git remote add origin ./server &&
16 git config branch.master.remote origin &&
17 git config branch.master.merge refs/heads/master &&
18 GIT_DIR=./server/.git git config hooks.post-receive-email.mailinglist commits@list.com &&
19 GIT_DIR=./server/.git git config hooks.post-receive-email.debug true &&
20 echo cbas >./server/.git/description
23 install_post_receive_hook 'post-receive-email'
25 test_expect_success 'simple commit' '
26 old_commit_hash=$(git rev-parse HEAD) &&
27 old_commit_abbrev=$(git rev-parse --short HEAD) &&
30 git commit -a -m "$test_name" &&
32 new_commit_hash=$(git rev-parse HEAD) &&
33 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
34 new_commit_abbrev=$(git rev-parse --short HEAD) &&
36 interpolate ../t2200-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_date new_commit_abbrev &&
37 test_cmp 1.txt server/.git/refs.heads.master.out
40 test_expect_success 'simple commit with commitnumber' '
41 old_commit_hash=$(git rev-parse HEAD) &&
42 old_commit_abbrev=$(git rev-parse --short HEAD) &&
45 git commit -a -m "$test_name" &&
49 new_commit_hash=$(git rev-parse HEAD) &&
50 new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
51 new_commit_abbrev=$(git rev-parse --short HEAD) &&
53 interpolate ../t2200-2.txt 2.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_date new_commit_abbrev &&
54 test_cmp 2.txt server/.git/refs.heads.master.out