summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-28 16:01:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-28 16:01:14 (GMT)
commit839b993f1f2a36e9e7511e4c279e4218c2127ed3 (patch)
tree89407b26543a6fe8b2ea0d2179d9b93a418da835 /builtin
parent50a6f65c2dee52fc3fe5a0e0b2f7460c71cf5a09 (diff)
parent22d3b8de1b625813faec6f3d6ffe66124837b78b (diff)
downloadgit-839b993f1f2a36e9e7511e4c279e4218c2127ed3.zip
git-839b993f1f2a36e9e7511e4c279e4218c2127ed3.tar.gz
git-839b993f1f2a36e9e7511e4c279e4218c2127ed3.tar.bz2
Merge branch 'jk/clone-copy-alternates-fix' into maint
"git clone" of a local repository can be done at the filesystem level, but the codepath did not check errors while copying and adjusting the file that lists alternate object stores. * jk/clone-copy-alternates-fix: clone: detect errors in normalize_path_copy
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index f044a8c..a35d622 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -355,8 +355,11 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
continue;
}
abs_path = mkpathdup("%s/objects/%s", src_repo, line.buf);
- normalize_path_copy(abs_path, abs_path);
- add_to_alternates_file(abs_path);
+ if (!normalize_path_copy(abs_path, abs_path))
+ add_to_alternates_file(abs_path);
+ else
+ warning("skipping invalid relative alternate: %s/%s",
+ src_repo, line.buf);
free(abs_path);
}
strbuf_release(&line);