]> git.ipfire.org Git - thirdparty/git.git/commit - transport.c
connect.c: refactor url parsing
authorTorsten Bögershausen <tboegi@web.de>
Thu, 28 Nov 2013 19:50:03 +0000 (20:50 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Dec 2013 22:54:48 +0000 (14:54 -0800)
commitc59ab2e52a64abd7fded97e0983a9b7f3d0508a0
treeec8fbc7ea0cc3a49ee0519425c486d03bb1325cc
parent83b058752707a6ba4af51ebc98c47913bc7d2d25
connect.c: refactor url parsing

Make the function is_local() in transport.c public, rename it into
url_is_local_not_ssh() and use it in both transport.c and connect.c

Use a protocol "local" for URLs for the local file system.

One note about using file:// under Windows:

The (absolute) path on Unix like system typically starts with "/".
When the host is empty, it can be omitted, so that a shell scriptlet
url=file://$pwd
will give a URL like "file:///home/user/repo".

Windows does not have the same concept of a root directory located in "/".
When parsing the URL allow "file://C:/user/repo"
(even if RFC1738 indicates that "file:///C:/user/repo" should be used).

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c
connect.h
t/t5500-fetch-pack.sh
t/t5601-clone.sh
transport.c