From: Junio C Hamano Date: Thu, 16 Aug 2007 03:55:44 +0000 (-0700) Subject: git-clone: allow --bare clone X-Git-Tag: v1.5.3-rc6~33 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=312efe9b58edb428132f0bf0fdc7f3d6a41f1183;p=git.git git-clone: allow --bare clone This is a stop-gap to work around problem with git-init without intrusive changes. Signed-off-by: Junio C Hamano --- diff --git a/git-clone.sh b/git-clone.sh index 4c9b1c971..e4a9ac4ba 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -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 diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh index 56f9d8ae7..822ac8c28 100755 --- a/t/t5701-clone-local.sh +++ b/t/t5701-clone-local.sh @@ -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 '