post-receive-delivery: add a deliver command
[git-central.git] / tests / t9000-notes.sh
1 #!/bin/bash
2
3 test_description='sanity check of commands listed in GitNotes'
4
5 . ./test-lib.sh
6
7 test_expect_success 'setup' '
8         echo setup >a &&
9         git add a &&
10         git commit -m "a" &&
11         git clone ./. server &&
12         git remote add origin ./server &&
13         rm -fr server/.git/hooks
14
15         git checkout -b stable &&
16         git push origin stable &&
17         git config --add branch.stable.remote origin &&
18         git config --add branch.stable.merge refs/heads/stable
19 '
20
21 test_expect_success 'make a new local/remote branch' '
22         git fetch &&
23         git checkout -b hotfix2 origin/stable &&
24         git push origin hotfix2 &&
25
26         # Initially we are still setup to pull from stable
27         git config --list | grep branch.hotfix2.merge=refs/heads/stable &&
28         git config --replace-all branch.hotfix2.merge refs/heads/hotfix2 &&
29
30         # But we want to pull from the new hotfix2 instead
31         git config --list | grep branch.hotfix2.merge=refs/heads/hotfix2
32 '
33
34 test_expect_success 'make a new local branch' '
35         # Remove the old hotfix2 local branch
36         git checkout origin/hotfix2 &&
37         git branch -d hotfix2 &&
38
39         # Now back to the real commands
40         git fetch &&
41         git checkout -b hotfix2 origin/hotfix2
42 '
43
44 test_done
45