Thread (1 message) 1 message, 1 author, 2017-03-16

Re: [PATCH 6/6] odb_pack_keep(): stop generating keepfile name

From: Junio C Hamano <hidden>
Date: 2017-03-16 01:24:27

Jeff King [off-list ref] 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
     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).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help