Re: [PATCH v2 39/53] refs/files-backend: convert many internals to struct object_id

2017-05-03 Thread brian m. carlson
On Mon, May 01, 2017 at 04:24:23PM -0700, Jonathan Tan wrote: > On 04/30/2017 07:29 PM, brian m. carlson wrote: > > - if (line->len <= 42) > > + if (!line->len) > > return NULL; > > I would omit this check - parse_oid_hex already exits early if the first > character is NUL. (The ex

Re: [PATCH v2 39/53] refs/files-backend: convert many internals to struct object_id

2017-05-01 Thread Jonathan Tan
On 04/30/2017 07:29 PM, brian m. carlson wrote: @@ -195,27 +195,18 @@ static const char PACKED_REFS_HEADER[] = * Return a pointer to the refname within the line (null-terminated), * or NULL if there was a problem. */ -static const char *parse_ref_line(struct strbuf *line, unsigned char *sha

[PATCH v2 39/53] refs/files-backend: convert many internals to struct object_id

2017-04-30 Thread brian m. carlson
Convert many of the internals of the files backend to use struct object_id. Avoid converting public APIs (except one change to refs/ref-cache.c) to limit the scope of the changes. Convert one use of get_sha1_hex to parse_oid_hex, and rely on the fact that a strbuf will be NUL-terminated and that