diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2015-09-28 20:06:15 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-28 10:46:35 -0700 |
commit | 744e4697555d4982acf0862f8fa6b15dd4796c37 (patch) | |
tree | 2898f43f225e423371f8567b6d8b7982c10f08c8 /builtin/clone.c | |
parent | 1f5fbe1fe2d04f6386cf8febc1ce308bcf815592 (diff) | |
download | git-744e4697555d4982acf0862f8fa6b15dd4796c37.tar.gz |
clone: allow --local from a linked checkout
Noticed-by: Bjørnar Snoksrud <snoksrud@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 578da85254..39d4adf7d1 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -424,8 +424,10 @@ static void clone_local(const char *src_repo, const char *dest_repo) } else { struct strbuf src = STRBUF_INIT; struct strbuf dest = STRBUF_INIT; - strbuf_addf(&src, "%s/objects", src_repo); - strbuf_addf(&dest, "%s/objects", dest_repo); + get_common_dir(&src, src_repo); + get_common_dir(&dest, dest_repo); + strbuf_addstr(&src, "/objects"); + strbuf_addstr(&dest, "/objects"); copy_or_link_directory(&src, &dest, src_repo, src.len); strbuf_release(&src); strbuf_release(&dest); |