handle_revision_arg: simplify commit reference lookups
commit1d6c93817bf22d6bf279bac302911cc93f63046c
authorJeff King <peff@peff.net>
Fri, 19 May 2017 12:48:46 +0000 (19 08:48 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 May 2017 01:59:27 +0000 (24 10:59 +0900)
tree0cffd902cab88d77d60ca88bbf1dda433a55f238
parented79b2cf034b81473dd1fa9648593b245c07daea
handle_revision_arg: simplify commit reference lookups

The "dotdot" range parser avoids calling
lookup_commit_reference() if we are directly fed two
commits. But its casts are unnecessarily complex; that
function will just return a commit we pass into it.

Just calling the function all the time is much simpler, and
doesn't do any significant extra work (the object is already
parsed, and deref_tag() on a non-tag is a noop; we do incur
one extra lookup_object() call, but that's fairly trivial).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c