summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-09-28 20:06:16 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-09-28 10:46:36 -0700
commitd78db8424ec5c3f3327441cd1a897064af39da91 (patch)
tree0c25f8f6e64d8eea131756604ce8b097f9f575b8
parentclone: allow --local from a linked checkout (diff)
downloadtgif-d78db8424ec5c3f3327441cd1a897064af39da91.tar.xz
clone: better error when --reference is a linked checkout
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/clone.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 39d4adf7d1..3e14491a34 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -294,9 +294,14 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
char *ref_git_git = mkpathdup("%s/.git", ref_git);
free(ref_git);
ref_git = ref_git_git;
- } else if (!is_directory(mkpath("%s/objects", ref_git)))
+ } else if (!is_directory(mkpath("%s/objects", ref_git))) {
+ struct strbuf sb = STRBUF_INIT;
+ if (get_common_dir(&sb, ref_git))
+ die(_("reference repository '%s' as a linked checkout is not supported yet."),
+ item->string);
die(_("reference repository '%s' is not a local repository."),
item->string);
+ }
if (!access(mkpath("%s/shallow", ref_git), F_OK))
die(_("reference repository '%s' is shallow"), item->string);