aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAlexander Potashev <aspotashev@gmail.com>2009-01-11 15:19:12 +0300
committerJunio C Hamano <gitster@pobox.com>2009-01-11 13:26:29 -0800
commit55892d23981917aefdb387ad7d0429f90cbd446a (patch)
tree72b1aab773fa37b50d07991de8a227994f1d6a7b /t
parent8ca12c0d62c0be4a4987c4a936467ea2a92e915a (diff)
downloadgit-55892d23981917aefdb387ad7d0429f90cbd446a.tar.gz
git-55892d23981917aefdb387ad7d0429f90cbd446a.tar.xz
Allow cloning to an existing empty directory
The die() message updated accordingly. The previous behaviour was to only allow cloning when the destination directory doesn't exist. [jc: added trivial tests] Signed-off-by: Alexander Potashev <aspotashev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 78a3fa639..fe287d31f 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