summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f733c70)
raw | patch | inline | side by side (parent: f733c70)
author | Johan Herland <johan@herland.net> | |
Mon, 1 Sep 2008 19:07:33 +0000 (21:07 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 2 Sep 2008 06:27:39 +0000 (23:27 -0700) |
On a local clone, "git clone" would use the fully DWIMmed path as the origin
URL in the resulting repo. This was slightly inconsistent with the case of a
remote clone where the _given_ URL was used as the origin URL (because the
DWIMming was done remotely, and was therefore not available to "git clone").
This behaviour caused problems when cloning a local non-bare repo with
relative submodule URLs, because these submodule URLs would then be resolved
against the DWIMmed URL (e.g. "/repo/.git") instead of the given URL (e.g.
"/repo").
This patch teaches "git clone" to use the _given_ URL - instead of the
DWIMmed path - as the origin URL. This causes relative submodule URLs to be
resolved correctly, as long the _given_ URL indicates the correct directory
against which the submodule URLs should be resolved.
The patch also updates a testcase that contained the old-style origin URLs.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
URL in the resulting repo. This was slightly inconsistent with the case of a
remote clone where the _given_ URL was used as the origin URL (because the
DWIMming was done remotely, and was therefore not available to "git clone").
This behaviour caused problems when cloning a local non-bare repo with
relative submodule URLs, because these submodule URLs would then be resolved
against the DWIMmed URL (e.g. "/repo/.git") instead of the given URL (e.g.
"/repo").
This patch teaches "git clone" to use the _given_ URL - instead of the
DWIMmed path - as the origin URL. This causes relative submodule URLs to be
resolved correctly, as long the _given_ URL indicates the correct directory
against which the submodule URLs should be resolved.
The patch also updates a testcase that contained the old-style origin URLs.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-clone.c | patch | blob | history | |
t/t5505-remote.sh | patch | blob | history |
diff --git a/builtin-clone.c b/builtin-clone.c
index c0e3086437ced05d1b81d4098e3a4c7c3031b0ee..f44eceab3a31ba38baaa5cbec366e69a989183d2 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
path = get_repo_path(repo_name, &is_bundle);
if (path)
- repo = path;
+ repo = xstrdup(make_nonrelative_path(repo_name));
else if (!strchr(repo_name, ':'))
repo = xstrdup(make_absolute_path(repo_name));
else
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index be9ee9326fc4590dcc875e31b6cf64b800451bc5..c4496635dfba85b0e9fc105c4516096d433881a4 100755 (executable)
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
cat > test/expect << EOF
* remote origin
- URL: $(pwd)/one/.git
+ URL: $(pwd)/one
Remote branch merged with 'git pull' while on branch master
master
New remote branch (next fetch will store in remotes/origin)
cat > test/expect << EOF
* remote origin
- URL: $(pwd)/one/.git
+ URL: $(pwd)/one
Remote branch merged with 'git pull' while on branch master
master
Tracked remote branches
cat > test/expect << EOF
Pruning origin
-URL: $(pwd)/one/.git
+URL: $(pwd)/one
* [would prune] origin/side2
EOF