summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-28 09:01:14 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-28 09:01:14 -0700
commit839b993f1f2a36e9e7511e4c279e4218c2127ed3 (patch)
tree89407b26543a6fe8b2ea0d2179d9b93a418da835
parentMerge branch 'dt/http-empty-auth' into maint (diff)
parentclone: detect errors in normalize_path_copy (diff)
downloadtgif-839b993f1f2a36e9e7511e4c279e4218c2127ed3.tar.xz
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
-rw-r--r--builtin/clone.c7
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);