diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-28 09:01:14 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-28 09:01:14 -0700 |
commit | 839b993f1f2a36e9e7511e4c279e4218c2127ed3 (patch) | |
tree | 89407b26543a6fe8b2ea0d2179d9b93a418da835 /builtin/clone.c | |
parent | 50a6f65c2dee52fc3fe5a0e0b2f7460c71cf5a09 (diff) | |
parent | 22d3b8de1b625813faec6f3d6ffe66124837b78b (diff) | |
download | git-839b993f1f2a36e9e7511e4c279e4218c2127ed3.tar.gz |
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/clone.c')
-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 f044a8c27f..a35d62293a 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); |