New branches should not get the update your local branch message.
[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 export USER=author
8
9 test_expect_success 'setup' '
10         echo "setup" >a &&
11         git add a &&
12         git commit -m "setup" &&
13         git clone ./. server &&
14         rm -fr server/.git/hooks &&
15         git remote add origin ./server &&
16         git config --add branch.master.remote origin &&
17         git config --add branch.master.merge refs/heads/master &&
18         GIT_DIR=./server/.git git config --add hooks.post-receive-email.mailinglist commits@list.com &&
19         GIT_DIR=./server/.git git config --add hooks.post-receive-email.debug true &&
20         GIT_DIR=.
21         echo cbas >./server/.git/description
22 '
23
24 install_post_receive_hook 'post-receive-email'
25
26 test_expect_success 'simple commit' '
27         old_commit_hash=$(git rev-parse HEAD) &&
28         old_commit_abbrev=$(git rev-parse --short HEAD) &&
29
30         echo $test_name >a &&
31         git commit -a -m "$test_name" &&
32         git push &&
33         new_commit_hash=$(git rev-parse HEAD) &&
34         new_commit_date=$(git log -n 1 --pretty=format:%cd HEAD) &&
35         new_commit_abbrev=$(git rev-parse --short HEAD) &&
36
37         interpolate ../t2200-1.txt 1.txt old_commit_hash old_commit_abbrev new_commit_hash new_commit_date new_commit_abbrev &&
38         test_cmp 1.txt server/.git/refs.heads.master.out
39 '
40
41 test_done
42