summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-04-05 14:14:04 -0400
committerJunio C Hamano <gitster@pobox.com>2019-04-16 16:58:21 +0900
commitb9fb142eac8053afc43344ef83bca0275d59b438 (patch)
treef1d69124ab03556521285692b3f2d2daa31cdb32 /builtin/commit.c
parent79bb8b3c80b902f43d2bc7cdf3afa2ffc2668c32 (diff)
server-info: drop objdirlen pointer arithmetic
When writing objects/info/packs, we use the basename of each pack (i.e., just the "pack-1234abcd.pack" part). We compute that manually by adding "objdirlen + 6" to the name. This _should_ work consistently, as we do not include non-local packs, meaning everything should be in $objdir/pack/. Before f13d7db4af (server-info.c: use pack_local like everybody else., 2005-12-05), this was definitely true, since we computed "local" based on comparing the objdir string. Since then, we're relying on the code on packfile.c to match our expectations of p->pack_name and p->local. I think our expectations do still hold today, but we can be a bit more defensive by just using pack_basename() to get the base. That future-proofs us, and should hopefully be more obviously safe to somebody reading the code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions