Re: [PATCH 11/12] sha1_name: convert get_sha1* to get_oid*

2017-07-07 Thread brian m. carlson
On Wed, Jul 05, 2017 at 11:38:51AM -0700, Junio C Hamano wrote: > Stefan Beller writes: > > >> @@ -636,7 +636,7 @@ static int get_sha1_basic(const char *str, int len, > >> unsigned char *sha1, > >> int detached; > >> > >> if

Re: [PATCH 11/12] sha1_name: convert get_sha1* to get_oid*

2017-07-05 Thread Junio C Hamano
Stefan Beller writes: >> @@ -636,7 +636,7 @@ static int get_sha1_basic(const char *str, int len, >> unsigned char *sha1, >> int detached; >> >> if (interpret_nth_prior_checkout(str, len, ) > 0) { >> - detached = (buf.len

Re: [PATCH 11/12] sha1_name: convert get_sha1* to get_oid*

2017-07-05 Thread Stefan Beller
> @@ -496,8 +496,8 @@ int find_unique_abbrev_r(char *hex, const unsigned char > *sha1, int len) > return 40; > exists = has_sha1_file(sha1); > while (len < 40) { Here are two prime candidates for GIT_SHA1_HEXSZ, too. > @@ -636,7 +636,7 @@ static int

[PATCH 11/12] sha1_name: convert get_sha1* to get_oid*

2017-07-03 Thread brian m. carlson
Now that all the callers of get_sha1 directly or indirectly use struct object_id, rename the functions starting with get_sha1 to start with get_oid. Convert the internals in sha1_name.c to use struct object_id as well, and eliminate explicit length checks where possible. Outside of sha1_name.c