Skip to content

Commit d78db84

Browse files
pcloudsgitster
authored andcommitted
clone: better error when --reference is a linked checkout
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 744e469 commit d78db84

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

builtin/clone.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,14 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
294294
char *ref_git_git = mkpathdup("%s/.git", ref_git);
295295
free(ref_git);
296296
ref_git = ref_git_git;
297-
} else if (!is_directory(mkpath("%s/objects", ref_git)))
297+
} else if (!is_directory(mkpath("%s/objects", ref_git))) {
298+
struct strbuf sb = STRBUF_INIT;
299+
if (get_common_dir(&sb, ref_git))
300+
die(_("reference repository '%s' as a linked checkout is not supported yet."),
301+
item->string);
298302
die(_("reference repository '%s' is not a local repository."),
299303
item->string);
304+
}
300305

301306
if (!access(mkpath("%s/shallow", ref_git), F_OK))
302307
die(_("reference repository '%s' is shallow"), item->string);

0 commit comments

Comments
 (0)