summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-01-14 23:29:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-14 23:29:28 (GMT)
commitc333fe73682b182d6872f9e5b454c2899c6203ab (patch)
treec23d3c44ba3e6d2ff2dc65d5b934b675abe5b1ec /revision.c
parentecbdaf0899161c067986e9d9d564586d4b045d62 (diff)
parent4cf67869b2ae3df7ab76b03c627f7b72d18d24ce (diff)
downloadgit-c333fe73682b182d6872f9e5b454c2899c6203ab.zip
git-c333fe73682b182d6872f9e5b454c2899c6203ab.tar.gz
git-c333fe73682b182d6872f9e5b454c2899c6203ab.tar.bz2
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index 13e0519..293303b 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);