提交 312efe9b 编写于 作者: J Junio C Hamano

git-clone: allow --bare clone

This is a stop-gap to work around problem with git-init without
intrusive changes.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d250626c
...@@ -215,7 +215,12 @@ else ...@@ -215,7 +215,12 @@ else
GIT_DIR="$D/.git" GIT_DIR="$D/.git"
fi && fi &&
export GIT_DIR && 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" if test -n "$reference"
then then
......
...@@ -8,13 +8,16 @@ D=`pwd` ...@@ -8,13 +8,16 @@ D=`pwd`
test_expect_success 'preparing origin repository' ' test_expect_success 'preparing origin repository' '
: >file && git add . && git commit -m1 && : >file && git add . && git commit -m1 &&
git clone --bare . a.git && 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' ' test_expect_success 'local clone without .git suffix' '
cd "$D" && cd "$D" &&
git clone -l -s a b && git clone -l -s a b &&
cd b && cd b &&
test "$(GIT_CONFIG=.git/config git config --bool core.bare)" = false &&
git fetch git fetch
' '
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册