Get tests passing again.
[git-central.git] / tests / t2800-post-receive-gitconfig.sh
1 #!/bin/bash
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 -l . --bare server.git &&
12         rm -fr server.git/hooks &&
13         git remote add origin ./server.git &&
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         ! GIT_DIR=server.git git config --list | grep foo &&
23
24         ../../scripts/create-gitconfig &&
25         git checkout gitconfig &&
26         echo "foo.foo=bar" > config &&
27         git commit -a -m "Set foo.foo=bar."
28         git push origin gitconfig
29
30         GIT_DIR=server.git git config --list | grep foo
31 '
32
33 test_expect_success 'pushing locked works' '
34         ! test -f server.git/locked &&
35
36         git checkout gitconfig &&
37         echo "foo" > locked &&
38         git add locked &&
39         git commit -m "Add locked"
40         git push origin gitconfig
41
42         test -f server.git/locked
43 '
44
45 test_done
46