Auto-deploy files other than config and hooks.
[git-central.git] / tests / t2800-post-receive-gitconfig.sh
1 #!/bin/sh
2
3 test_description='server update git config'
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 branch.master.remote origin &&
15         git config branch.master.merge refs/heads/master &&
16         git fetch
17 '
18
19 install_post_receive_hook 'post-receive-gitconfig'
20
21 test_expect_success 'pushing initial value works' '
22         cd server &&
23         ! git config --list | grep foo &&
24         cd .. &&
25
26         ../../scripts/create-gitconfig &&
27         git checkout gitconfig &&
28         echo "foo.foo=bar" > config &&
29         git commit -a -m "Set foo.foo=bar."
30         git push origin gitconfig
31
32         cd server &&
33         git config --list | grep foo &&
34         cd ..
35 '
36
37 test_expect_success 'pushing locked works' '
38         ! test -f server/.git/locked &&
39
40         git checkout gitconfig &&
41         echo "foo" > locked &&
42         git add locked &&
43         git commit -m "Add locked"
44         git push origin gitconfig
45
46         test -f server/.git/locked
47 '
48
49 test_done
50