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
This commit is contained in:
Junio C Hamano 2016-10-17 13:25:18 -07:00
Родитель c6400bf8d5 22d3b8de1b
Коммит 630e05c4f3
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -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);