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 <gitster@pobox.com>
Junio C Hamano committed
Aug 15, 2007 at 20:55 UTC
312efe9b58edb428132f0bf0fdc7f3d6a41f1183
2 files changed
+10
-2
git-clone.sh
+6
-1
@@ -215,7 +215,12 @@ else
215
GIT_DIR="$D/.git"
216
fi &&
217
export GIT_DIR &&
218
-git-init $quiet ${template+"$template"} || usage
218
+GIT_CONFIG="$GIT_DIR/config" git-init $quiet ${template+"$template"} || usage
219
+
220
+if test -n "$bare"
221
+then
222
+ GIT_CONFIG="$GIT_DIR/config" git config core.bare true
223
+fi
224
225
if test -n "$reference"
226
then
t/t5701-clone-local.sh
+4
-1
@@ -8,13 +8,16 @@ D=`pwd`
8
test_expect_success 'preparing origin repository' '
9
: >file && git add . && git commit -m1 &&
10
git clone --bare . a.git &&
11
- git clone --bare . x
11
+ git clone --bare . x &&
12
+ test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
13
+ test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
14
'
15
16
test_expect_success 'local clone without .git suffix' '
17
cd "$D" &&
18
git clone -l -s a b &&
19
cd b &&
20
+ test "$(GIT_CONFIG=.git/config git config --bool core.bare)" = false &&
21
git fetch
22
'
23