Skip to content

Commit

Permalink
git-clone: allow --bare clone
Browse files Browse the repository at this point in the history
This is a stop-gap to work around problem with git-init without
intrusive changes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Aug 16, 2007
1 parent d250626 commit 312efe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion t/t5701-clone-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'

Expand Down

0 comments on commit 312efe9

Please sign in to comment.