path: root/builtin/notes.c
diff options
authorJeff King <>2017-03-28 19:46:47 (GMT)
committerJunio C Hamano <>2017-03-30 21:59:50 (GMT)
commit446d5d911214fd3d61921478c98d4a88f84e410c (patch)
treeaba115ccfcf2e205ffbd5420abb02dbdf8c971e6 /builtin/notes.c
parent903fc7da44b091a87c4bc00a892930786c71a709 (diff)
receive-pack: print --pack-header directly into argv array
After receive-pack reads the pack header from the client, it feeds the already-read part to index-pack and unpack-objects via their --pack-header command-line options. To do so, we format it into a fixed buffer, then duplicate it into the child's argv_array. Our buffer is long enough to handle any possible input, so this isn't wrong. But it's more complicated than it needs to be; we can just argv_array_pushf() the final value and avoid the intermediate copy. This drops the magic number and is more efficient, too. Note that we need to push to the argv_array in order, which means we can't do the push until we are in the "unpack-objects versus index-pack" conditional. Rather than duplicate the slightly complicated format specifier, I pushed it into a helper function. Signed-off-by: Jeff King <>
Diffstat (limited to 'builtin/notes.c')
0 files changed, 0 insertions, 0 deletions