Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2008-09-03 22:55:55 +0400
committerJunio C Hamano <gitster@pobox.com>2008-09-03 23:32:41 +0400
commit44a68fd526a70f0aaf213143e22f1257f296e724 (patch)
treeca7712d5b61eb0de74fdd626bfc168a5fce9f9be /t
parentdb3a95459cb873c302051b4b2b693be5ba248c13 (diff)
clone: fix creation of explicitly named target directory
'git clone <repo> path/' (note the trailing slash) fails, because the entire path is interpreted as leading directories. So when mkdir tries to create the actual path, it already exists. This makes sure trailing slashes are removed. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5601-clone.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 59c65fef28..78a3fa639c 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -107,4 +107,22 @@ test_expect_success 'clone --mirror does not repeat tags' '
'
+test_expect_success 'clone to destination with trailing /' '
+
+ git clone src target-1/ &&
+ T=$( cd target-1 && git rev-parse HEAD ) &&
+ S=$( cd src && git rev-parse HEAD ) &&
+ test "$T" = "$S"
+
+'
+
+test_expect_success 'clone to destination with extra trailing /' '
+
+ git clone src target-2/// &&
+ T=$( cd target-2 && git rev-parse HEAD ) &&
+ S=$( cd src && git rev-parse HEAD ) &&
+ test "$T" = "$S"
+
+'
+
test_done