summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2019-04-05 14:14:04 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-04-16 16:58:21 +0900
commitb9fb142eac8053afc43344ef83bca0275d59b438 (patch)
treef1d69124ab03556521285692b3f2d2daa31cdb32 /utf8.h
parentserver-info: drop nr_alloc struct member (diff)
downloadtgif-b9fb142eac8053afc43344ef83bca0275d59b438.tar.xz
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 'utf8.h')
0 files changed, 0 insertions, 0 deletions