Re: [PATCH 6/6] odb_pack_keep(): stop generating keepfile name
- Date: Wed, 15 Mar 2017 18:24:18 -0700
- From: Junio C Hamano <gitster@xxxxxxxxx>
- Subject: Re: [PATCH 6/6] odb_pack_keep(): stop generating keepfile name
Jeff King <peff@xxxxxxxx> writes:
> 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
> 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).