summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-01-17 23:05:54 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-01-17 23:05:54 -0800
commit6af384ce73ad880253be5be7587f19f6fe3afcba (patch)
treec63418b88b19af0eb7ca37adfffa49408e57bc79 /t
parentMerge branch 'jc/maint-format-patch' (diff)
parentAllow cloning to an existing empty directory (diff)
downloadtgif-6af384ce73ad880253be5be7587f19f6fe3afcba.tar.xz
Merge branch 'ap/clone-into-empty'
* ap/clone-into-empty: Allow cloning to an existing empty directory add is_dot_or_dotdot inline function
Diffstat (limited to 't')
-rwxr-xr-xt/t5601-clone.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 78a3fa639c..fe287d31fb 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -125,4 +125,23 @@ test_expect_success 'clone to destination with extra trailing /' '
'
+test_expect_success 'clone to an existing empty directory' '
+ mkdir target-3 &&
+ git clone src target-3 &&
+ T=$( cd target-3 && git rev-parse HEAD ) &&
+ S=$( cd src && git rev-parse HEAD ) &&
+ test "$T" = "$S"
+'
+
+test_expect_success 'clone to an existing non-empty directory' '
+ mkdir target-4 &&
+ >target-4/Fakefile &&
+ test_must_fail git clone src target-4
+'
+
+test_expect_success 'clone to an existing path' '
+ >target-5 &&
+ test_must_fail git clone src target-5
+'
+
test_done