Re: [PATCH 08/31] notes: make hash size independent
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 12, 2019, 01:37 UTC
- Message-ID
- <CAPig+cRQrkeD6rL8M9pL4kjPTwbPdjUYyH4Kes3jk9Wn0O-NtA@mail.gmail.com>
- In-Reply-To
- <20190212012256.1005924-9-sandals@crustytoothpaste.net>
On Mon, Feb 11, 2019 at 8:23 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:
Show 12 quoted lines
> Switch out various uses of the GIT_SHA1_* constants with GIT_MAX_* > constants for allocations and the_hash_algo for general parsing. Update > a comment to no longer be SHA-1 specific. > > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> > --- > diff --git a/notes.c b/notes.c > @@ -527,15 +529,15 @@ static unsigned char determine_fanout(struct int_node *tree, unsigned char n, > -/* hex SHA1 + 19 * '/' + NUL */ > -#define FANOUT_PATH_MAX GIT_SHA1_HEXSZ + FANOUT_PATH_SEPARATORS + 1 > +/* hex oid + one slash between each pair + NUL */ > +#define FANOUT_PATH_MAX GIT_MAX_HEXSZ + FANOUT_PATH_SEPARATORS_MAX + 1
I had trouble understanding to what pair you are referring. I _think_ you mean "pair of hex digits". If so, perhaps:
/* hex oid + '/' between each pair of hex digits + NUL */
(but not worth a re-roll).