]> git.ipfire.org Git - thirdparty/git.git/commit - server-info.c
server-info: use strbuf to read old info/packs file
authorJeff King <peff@peff.net>
Fri, 5 Apr 2019 18:13:56 +0000 (14:13 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Apr 2019 07:58:21 +0000 (16:58 +0900)
commit4ecbd6492cde3fcf003c387414b3e9983fb2ba4b
tree818fd510da857e266133579f4e3c9c25a6d9040d
parent965cc517e57f01d8013fa7b10c1d5ce72ba3e272
server-info: use strbuf to read old info/packs file

This old code uses fgets with a fixed-size buffer. Let's use a strbuf
instead, so we don't have to wonder if "1000" is big enough, or what
happens if we see a long line.

This also lets us drop our custom code to trim the newline.

Probably nobody actually cares about the 1000-char limit (after all, the
lines generally only say "P pack-[0-9a-f]{40}.pack"), so this is mostly
just about cleanup/readability.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
server-info.c