From: Hui Wang Date: Tue, 23 Aug 2011 03:43:05 GMT Subject: Re: [PATCH 0/2] clone-local fixup Message-ID: <4E5321C9.4080301@gmail.com> In-Reply-To: <1314061516-24964-1-git-send-email-gitster@pobox.com> This patch series solved the problem from the root cause. :-) But there is a little problem in the second patch, i provide an incremental patch basing on your second patch, if it is fine to you, it is OK to squash this patch to your second patch. commit 47e890818fdac5f6493cd0bbaf9da350785a2bca Author: Hui Wang Date: Tue Aug 23 11:32:26 2011 +0800 clone: don't change absolute path in the copy_alternates The source alternates may include empty lines, comment lines, relative paths and absolute paths. Absolute paths don't need to be changed before added to the destination alternates. Signed-off-by: Hui Wang diff --git a/builtin/clone.c b/builtin/clone.c index 2842707..284e325 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -258,6 +258,10 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst, char *abs_path, abs_buf[PATH_MAX]; if (!line.len || line.buf[0] == '#') continue; + if (is_absolute_path(line.buf)) { + add_to_alternates_file(line.buf); + continue; + } abs_path = mkpath("%s/objects/%s", src_repo, line.buf); normalize_path_copy(abs_buf, abs_path); add_to_alternates_file(abs_buf); Regards, Hui. Junio C Hamano wrote: > So I ended up tackling this myself. I didn't bother moving the > add_to_alternates_file(), though. > > Junio C Hamano (2): > clone: allow more than one --reference > clone: clone from a repository with relative alternates > > builtin/clone.c | 82 +++++++++++++++++++++++++++++++++++++++++------------ > sha1_file.c | 2 +- > t/t5601-clone.sh | 23 +++++++++++++++ > 3 files changed, 87 insertions(+), 20 deletions(-) > >