Re: [PATCH 2/3] http-push: use hex_to_bytes()

2017-11-04 Thread René Scharfe
Am 01.11.2017 um 23:15 schrieb Jeff King: > On Wed, Nov 01, 2017 at 10:59:49PM +0100, René Scharfe wrote: > >>> The hex_to_bytes() function requires that the caller make sure they have >>> the right number of bytes. But for many callers, I think they'd want to >>> say "parse this oid, which might

Re: [PATCH 2/3] http-push: use hex_to_bytes()

2017-11-01 Thread Jeff King
On Wed, Nov 01, 2017 at 10:59:49PM +0100, René Scharfe wrote: > > The hex_to_bytes() function requires that the caller make sure they have > > the right number of bytes. But for many callers, I think they'd want to > > say "parse this oid, which might be truncated; I can't tell what the > >

Re: [PATCH 2/3] http-push: use hex_to_bytes()

2017-11-01 Thread René Scharfe
Am 01.11.2017 um 20:55 schrieb Jeff King: > On Tue, Oct 31, 2017 at 02:49:56PM +0100, René Scharfe wrote: > >> 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

Re: [PATCH 2/3] http-push: use hex_to_bytes()

2017-11-01 Thread Jeff King
On Tue, Oct 31, 2017 at 02:49:56PM +0100, René Scharfe wrote: > 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

[PATCH 2/3] http-push: use hex_to_bytes()

2017-10-31 Thread René Scharfe
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