From: Junio C Hamano Date: Fri, 1 Jun 2018 06:06:39 +0000 (+0900) Subject: Merge branch 'en/rev-parse-invalid-range' X-Git-Tag: v2.18.0-rc1~14 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7cb4a974d339d774cb439b3d8c8f41f1ca584e6f Merge branch 'en/rev-parse-invalid-range' "git rev-parse Y..." etc. misbehaved when given endpoints were not committishes. * en/rev-parse-invalid-range: rev-parse: check lookup'ed commit references for NULL --- 7cb4a974d339d774cb439b3d8c8f41f1ca584e6f diff --cc builtin/rev-parse.c index 55c0b90441,da5748bdae..4f49e96bfd --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@@ -280,8 -280,12 +280,12 @@@ static int try_difference(const char *a if (symmetric) { struct commit_list *exclude; struct commit *a, *b; - a = lookup_commit_reference(&oid); - b = lookup_commit_reference(&end); + a = lookup_commit_reference(&start_oid); + b = lookup_commit_reference(&end_oid); + if (!a || !b) { + *dotdot = '.'; + return 0; + } exclude = get_merge_bases(a, b); while (exclude) { struct commit *commit = pop_commit(&exclude);