Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [PATCH 0/2] clone-local fixup

From: Hui Wang <hidden>
Date: 2016-06-15 22:51:52
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

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 [off-list ref]
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 [off-list ref]
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(-)

  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help