summaryrefslogtreecommitdiff
path: root/t/t5701-clone-local.sh
diff options
context:
space:
mode:
authorSverre Rabbelier <srabbelier@gmail.com>2009-01-23 01:07:32 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-23 00:19:49 -0800
commit86ac751859033741a120e9e4a91133d075d9d898 (patch)
treea417cdbc68de4f23cb8ae6ebd0269108d771f580 /t/t5701-clone-local.sh
parent9a01387b9714452ebcae431705a288e1a7e099c3 (diff)
downloadgit-86ac751859033741a120e9e4a91133d075d9d898.tar.gz
Allow cloning an empty repository
Cloning an empty repository manually (that is, doing 'git init' and then doing all configuration by hand) can be a lot of work. Save the user this work by allowing the cloning of empty repositories. Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5701-clone-local.sh')
-rwxr-xr-xt/t5701-clone-local.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh
index 8dfaaa456e..fbd9bfa573 100755
--- a/t/t5701-clone-local.sh
+++ b/t/t5701-clone-local.sh
@@ -116,4 +116,20 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
test ! -e .git/refs/heads/master
'
+test_expect_success 'clone empty repository' '
+ cd "$D" &&
+ mkdir empty &&
+ (cd empty && git init) &&
+ git clone empty empty-clone &&
+ test_tick &&
+ (cd empty-clone
+ echo "content" >> foo &&
+ git add foo &&
+ git commit -m "Initial commit" &&
+ git push origin master &&
+ expected=$(git rev-parse master) &&
+ actual=$(git --git-dir=../empty/.git rev-parse master) &&
+ test $actual = $expected)
+'
+
test_done