From: brian m. carlson Date: Fri, 07 Jul 2017 21:22:01 GMT Subject: Re: [PATCH 11/12] sha1_name: convert get_sha1* to get_oid* Message-ID: <20170707212201.ofdgjaips2tw3koy@genre.crustytoothpaste.net> In-Reply-To: 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 (interpret_nth_prior_checkout(str, len, &buf) > 0) { > >> - detached = (buf.len == 40 && !get_sha1_hex(buf.buf, sha1)); > >> + detached = (!get_oid_hex(buf.buf, oid)); > > > > omitting the length check here? > > Good eyes. It probably should check with the possible oid lengths. I'll reroll. This may have been a bad conflict resolution on my part. -- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204