Get tests passing again.
[git-central.git] / tests / t2800-post-receive-gitconfig.sh
index 6933fc8..4691139 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 test_description='server update git config'
 
@@ -8,9 +8,9 @@ test_expect_success 'setup' '
        echo "setup" >a &&
        git add a &&
        git commit -m "setup" &&
-       git clone ./. server &&
-       rm -fr server/.git/hooks &&
-       git remote add origin ./server &&
+       git clone -l . --bare server.git &&
+       rm -fr server.git/hooks &&
+       git remote add origin ./server.git &&
        git config branch.master.remote origin &&
        git config branch.master.merge refs/heads/master &&
        git fetch
@@ -19,9 +19,7 @@ test_expect_success 'setup' '
 install_post_receive_hook 'post-receive-gitconfig'
 
 test_expect_success 'pushing initial value works' '
-       cd server &&
-       ! git config --list | grep foo &&
-       cd .. &&
+       ! GIT_DIR=server.git git config --list | grep foo &&
 
        ../../scripts/create-gitconfig &&
        git checkout gitconfig &&
@@ -29,13 +27,11 @@ test_expect_success 'pushing initial value works' '
        git commit -a -m "Set foo.foo=bar."
        git push origin gitconfig
 
-       cd server &&
-       git config --list | grep foo &&
-       cd ..
+       GIT_DIR=server.git git config --list | grep foo
 '
 
 test_expect_success 'pushing locked works' '
-       ! test -f server/.git/locked &&
+       ! test -f server.git/locked &&
 
        git checkout gitconfig &&
        echo "foo" > locked &&
@@ -43,7 +39,7 @@ test_expect_success 'pushing locked works' '
        git commit -m "Add locked"
        git push origin gitconfig
 
-       test -f server/.git/locked
+       test -f server.git/locked
 '
 
 test_done