Tweak the email format.
[git-central.git] / tests / t2200-server-post-receive-email.sh
1 #!/bin/sh
2
3 test_description='server post-receive email notification'
4
5 . ./test-lib.sh
6
7 test_expect_success 'setup' '
8         echo "setup" >a &&
9         git add a &&
10         git commit -m "setup" &&
11         git clone ./. server &&
12         rm -fr server/.git/hooks &&
13         git remote add origin ./server &&
14         git config --add branch.master.remote origin &&
15         git config --add branch.master.merge refs/heads/master &&
16         GIT_DIR=./server/.git git config --add hooks.mailinglist commits@list.com &&
17         GIT_DIR=./server/.git git config --add hooks.debug true &&
18         GIT_DIR=.
19         echo cbas >./server/.git/description
20 '
21
22 install_server_hook 'post-receive-email' 'post-receive'
23
24 test_expect_success 'simple commit' '
25         echo $test_name >a &&
26         git commit -a -m "$test_name" &&
27         git push &&
28         old_commit_hash=$(git rev-parse HEAD^) &&
29         new_commit_hash=$(git rev-parse HEAD) &&
30         new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
31         interpolate ../t2200-1.txt 1.txt old_commit_hash new_commit_hash new_commit_date &&
32         test_cmp 1.txt server/.git/refs.heads.master.out
33 '
34
35 test_done
36