diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-01-14 15:29:28 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-14 15:29:28 -0800 |
commit | c333fe73682b182d6872f9e5b454c2899c6203ab (patch) | |
tree | c23d3c44ba3e6d2ff2dc65d5b934b675abe5b1ec /revision.c | |
parent | First batch after 2.20.1 (diff) | |
parent | list-objects.c: don't segfault for missing cmdline objects (diff) | |
download | tgif-c333fe73682b182d6872f9e5b454c2899c6203ab.tar.xz |
Merge branch 'md/list-lazy-objects-fix'
"git rev-list --exclude-promisor-objects" had to take an object
that does not exist locally (and is lazily available) from the
command line without barfing, but the code dereferenced NULL.
* md/list-lazy-objects-fix:
list-objects.c: don't segfault for missing cmdline objects
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 13e0519c02..293303b67d 100644 --- a/revision.c +++ b/revision.c @@ -1729,6 +1729,8 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi if (!cant_be_filename) verify_non_filename(revs->prefix, arg); object = get_reference(revs, arg, &oid, flags ^ local_flags); + if (!object) + return revs->ignore_missing ? 0 : -1; add_rev_cmdline(revs, object, arg_, REV_CMD_REV, flags ^ local_flags); add_pending_object_with_path(revs, object, arg, oc.mode, oc.path); free(oc.path); |