diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-17 13:25:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-17 13:25:18 -0700 |
commit | 630e05c4f3121aa67dcb1399b62e4c3767d8be55 (patch) | |
tree | 84c15c832ae77cd76398bf89b35152c08a8a99a8 /builtin | |
parent | c6400bf8d5437e7614c86e6b027761e11ed7a1be (diff) | |
parent | 22d3b8de1b625813faec6f3d6ffe66124837b78b (diff) | |
download | git-630e05c4f3121aa67dcb1399b62e4c3767d8be55.tar.gz git-630e05c4f3121aa67dcb1399b62e4c3767d8be55.tar.xz |
Merge branch 'jk/clone-copy-alternates-fix'
"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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 6c80690ad..6c76a6ed6 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -351,8 +351,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); |