]> git.ipfire.org Git - thirdparty/git.git/commit
patch-id: use oid_to_hex() to print multiple object IDs
authorRené Scharfe <l.s.r@web.de>
Sat, 7 Dec 2019 19:16:51 +0000 (20:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Dec 2019 20:26:40 +0000 (12:26 -0800)
commit4507ecc7710e172ed36421eaa4efe743785ccb4b
treeee566f2a213cb23c4f332a611422a26b19c86e72
parentda72936f544fec5a335e66432610e4cef4430991
patch-id: use oid_to_hex() to print multiple object IDs

flush_current_id() prints the hexadecimal representation of two object
IDs.  When the code was added in f97672225b (Add "git-patch-id" program
to generate patch ID's., 2005-06-23), sha1_to_hex() had only a single
internal static buffer, so the result of one invocation had to be stored
in a local buffer.

Since dcb3450fd8 (sha1_to_hex() usage cleanup, 2006-05-03) it rotates
through four buffers, which allows to print up to four object IDs at the
same time.  1a876a69af6 (patch-id: convert to use struct object_id,
2015-03-13) replaced sha1_to_hex() with oid_to_hex(), which has the same
feature.  Use it to simplify the code.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/patch-id.c