git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] clone: local URLs are not for ssh

From
Torsten Bögershausen <tboegi@web.de>
Date
Oct 5, 2013, 19:48 UTC
Message-ID
<52506D15.9040206@web.de>
In-Reply-To
<20131003013127.GA7917@sigill.intra.peff.net>
On 2013-10-03 03.31, Jeff King wrote:
Show 13 quoted lines
> On Thu, Oct 03, 2013 at 08:01:23AM +0700, Nguyen Thai Ngoc Duy wrote:
> 
>>> 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
 '
Previous: Jeff KingNext: Matthieu Moy
Message 6 of 10 in “clone: local URLs are not for ssh”
  1. clone: local URLs are not for sshTorsten Bögershausen, Sep 28, 2013
  2. Duy NguyenSep 29, 2013
  3. Torsten BögershausenOct 2, 2013
  4. Duy NguyenOct 3, 2013
  5. Jeff KingOct 3, 2013
  6. Torsten BögershausenOct 5, 2013
  7. Matthieu MoyOct 5, 2013
  8. Torsten BögershausenOct 13, 2013
  9. Jeff KingOct 15, 2013
  10. Torsten BögershausenOct 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.