summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-09-28 13:06:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-28 17:46:35 (GMT)
commit744e4697555d4982acf0862f8fa6b15dd4796c37 (patch)
tree2898f43f225e423371f8567b6d8b7982c10f08c8 /builtin/clone.c
parent1f5fbe1fe2d04f6386cf8febc1ce308bcf815592 (diff)
downloadgit-744e4697555d4982acf0862f8fa6b15dd4796c37.zip
git-744e4697555d4982acf0862f8fa6b15dd4796c37.tar.gz
git-744e4697555d4982acf0862f8fa6b15dd4796c37.tar.bz2
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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 578da85..39d4adf 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);