Skip to content

Commit 0658569

Browse files
aschrabgitster
authored andcommitted
clone: Fix error message for reference repository
Do not report that an argument to clone's --reference option is not a local directory. Nothing checks for the existence or type of the path as supplied by the user; checks are only done for particular contents of the supposed directory, so we have no way to know the status of the supplied path. Telling the user that a directory doesn't exist when that isn't actually known may lead him or her on the wrong path to finding the problem. Instead just state that the entered path is not a local repository which is really all that is known about it. It could be more helpful to state the actual paths which were checked, but I believe that giving a good description of that would be too verbose for a simple error message and would be too dependent on implementation details. Signed-off-by: Aaron Schrab <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 52a3e01 commit 0658569

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
241241
free(ref_git);
242242
ref_git = ref_git_git;
243243
} else if (!is_directory(mkpath("%s/objects", ref_git)))
244-
die(_("reference repository '%s' is not a local directory."),
244+
die(_("reference repository '%s' is not a local repository."),
245245
item->string);
246246

247247
strbuf_addf(&alternate, "%s/objects", ref_git);

0 commit comments

Comments
 (0)