grep: avoid using oid_to_hex() with parse_object_or_die()
commit98c6871fad0be42fbe045de2338d0a5bdbc5af1d
authorRené Scharfe <l.s.r@web.de>
Tue, 28 Jul 2020 21:40:38 +0000 (28 23:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Jul 2020 22:26:12 +0000 (28 15:26 -0700)
tree76bb02be2357440e4c8f383e388da0e2bbfe20bc
parentb3d7a52fac39193503a0b6728771d1bf6a161464
grep: avoid using oid_to_hex() with parse_object_or_die()

parse_object_or_die() is passed an object ID and a name to show if the
object cannot be parsed.  If the name is NULL then it shows the
hexadecimal object ID.  Use that feature instead of preparing and
passing the hexadecimal representation to the function proactively.
That's shorter and a bit more efficient.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c