mirror of
https://github.com/git/git.git
synced 2026-03-04 22:47:35 +01:00
Merge branch 'mm/diff-no-index-find-object' into next
"git diff --no-index --find-object=<object-name>" outside a repository of course wouldn't be able to find the object and died while parsing the command line, which is made to die in a bit more user-friendly way. * mm/diff-no-index-find-object: diff: fix crash with --find-object outside repository
This commit is contained in:
2
diff.c
2
diff.c
@@ -5224,6 +5224,8 @@ static int diff_opt_find_object(const struct option *option,
|
||||
struct object_id oid;
|
||||
|
||||
BUG_ON_OPT_NEG(unset);
|
||||
if (!startup_info->have_repository)
|
||||
return error(_("--find-object requires a git repository"));
|
||||
if (repo_get_oid(the_repository, arg, &oid))
|
||||
return error(_("unable to resolve '%s'"), arg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user