Re: [PATCH] clone: local URLs are not for ssh
From: Torsten Bögershausen <hidden>
Date: 2016-06-15 22:58:57
Subsystem:
the rest · Maintainer:
Linus Torvalds
On 2013-10-03 03.31, Jeff King wrote:
On Thu, Oct 03, 2013 at 08:01:23AM +0700, Nguyen Thai Ngoc Duy wrote:quoted
quoted
Sorry for the noise, I noticed it when I was trying to construct test cases. What do we think about adding this at the end of t5505:As usual more tests are usually better. But is t5505-remote.sh the best place? That file seems about "git remote"..Yeah, agreed. How about at the end of t5601, after the ssh wrapper I set up here: http://article.gmane.org/gmane.comp.version-control.git/235473
Thanks for the review & pointer. To get it working, a little tweak was needed here, please see below.
diff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh
index d232e94..37464aa 100755
--- a/t/t5602-clone-remote-exec.sh
+++ b/t/t5602-clone-remote-exec.sh@@ -62,21 +62,20 @@ expect_ssh () { test_expect_success 'cloning myhost:src uses ssh' ' clear_ssh && - git clone myhost:src ssh-clone && + ! git clone myhost:src ssh-clone && expect_ssh myhost src ' -test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' ' +test_expect_success SYMLINKS,NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' ' clear_ssh && - cp -R src "foo:bar" && - git clone "./foo:bar" foobar - git clone "./foo:bar" foobar && + ln -s src "foo:bar" && + ! git clone "./foo:bar" foobar && expect_ssh none ' test_expect_success 'bracketed hostnames are still ssh' ' clear_ssh && - git clone "[myhost:123]:src" ssh-bracket-clone && + ! git clone "[myhost:123]:src" ssh-bracket-clone && expect_ssh myhost:123 src '