]> git.ipfire.org Git - thirdparty/git.git/commit - http-push.c
http-push: use hex_to_bytes()
authorRené Scharfe <l.s.r@web.de>
Tue, 31 Oct 2017 13:49:56 +0000 (14:49 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2017 01:35:39 +0000 (10:35 +0900)
commitc3bdc4e7795023863756cf6176c1ab32793459a1
tree5494f784bb418e648755296a4598b0b69dbd7181
parent0ec218656a02ea48e173262f7b80513feeb7f263
http-push: use hex_to_bytes()

The path of a loose object contains its hash value encoded into two
substrings of hexadecimal digits, separated by a slash.  The current
code copies the pieces into a temporary buffer to get rid of the slash
and then uses get_oid_hex() to decode the hash value.

Avoid the copy by using hex_to_bytes() directly on the substrings.
That's shorter and easier.

While at it correct the length of the second substring in a comment.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c