Re: [PATCH 6/6] odb_pack_keep(): stop generating keepfile name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 16, 2017, 01:24 UTC
- Message-ID
- <xmqqzigmc8u5.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170315213024.jjhikkgwuhev27ec@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> The odb_pack_keep() function generates the name of a .keep > file and opens it. This has two problems: > > 1. It requires a fixed-size buffer to create the filename > and doesn't notice when the result is truncated. > > 2. Of the two callers, one sometimes wants to open a > filename it already has, which makes things awkward (it > has to do so manually, and skips the leading-directory > creation). > > Instead, let's have odb_pack_keep() just open the file. > Callers can use odb_pack_name() separately to generate the > name. This simplifies the callers, and lets us drop any > buffer-size limitations.
That's sensible (and all the others made the resulting code much more pleasant to the eyes).