]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-clone: allow --bare clone
authorJunio C Hamano <gitster@pobox.com>
Thu, 16 Aug 2007 03:55:44 +0000 (20:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Aug 2007 04:39:07 +0000 (21:39 -0700)
This is a stop-gap to work around problem with git-init without
intrusive changes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-clone.sh
t/t5701-clone-local.sh

index 4c9b1c9710c0fd55dfdbaf6bec6b77e0dae93562..e4a9ac4babcb0d0b3c2f9aac48925a18cd71f61f 100755 (executable)
@@ -215,7 +215,12 @@ else
        GIT_DIR="$D/.git"
 fi &&
 export GIT_DIR &&
-git-init $quiet ${template+"$template"} || usage
+GIT_CONFIG="$GIT_DIR/config" git-init $quiet ${template+"$template"} || usage
+
+if test -n "$bare"
+then
+       GIT_CONFIG="$GIT_DIR/config" git config core.bare true
+fi
 
 if test -n "$reference"
 then
index 56f9d8ae734b130f3d6b978f00eeeaf8df2a2873..822ac8c28e112dc1da61cb7fecdab1b4f25717ec 100755 (executable)
@@ -8,13 +8,16 @@ D=`pwd`
 test_expect_success 'preparing origin repository' '
        : >file && git add . && git commit -m1 &&
        git clone --bare . a.git &&
-       git clone --bare . x
+       git clone --bare . x &&
+       test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
+       test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
 '
 
 test_expect_success 'local clone without .git suffix' '
        cd "$D" &&
        git clone -l -s a b &&
        cd b &&
+       test "$(GIT_CONFIG=.git/config git config --bool core.bare)" = false &&
        git fetch
 '