diff options
author | Jeff King <peff@peff.net> | 2014-12-10 05:40:07 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-12-10 09:27:24 -0800 |
commit | 10c497aa0cc7ccb5bd213f53fc0cd803bd73a508 (patch) | |
tree | d6820a550c72b2d52432df90b47808f1ca3c9a6f /t/t1060-object-corruption.sh | |
parent | Merge branch 'nd/gitignore-trailing-whitespace' into maint (diff) | |
download | tgif-10c497aa0cc7ccb5bd213f53fc0cd803bd73a508.tar.xz |
read_packed_refs: use a strbuf for reading lines
Current code uses a fixed PATH_MAX-sized buffer for reading
packed-refs lines. This is a reasonable guess, in the sense
that git generally cannot work with refs larger than
PATH_MAX. However, there are a few cases where it is not
great:
1. Some systems may have a low value of PATH_MAX, but can
actually handle larger paths in practice. Fixing this
code path probably isn't enough to make them work
completely with long refs, but it is a step in the
right direction.
2. We use fgets, which will happily give us half a line on
the first read, and then the rest of the line on the
second. This is probably OK in practice, because our
refline parser is careful enough to look for the
trailing newline on the first line. The second line may
look like a peeled line to us, but since "^" is illegal
in refnames, it is not likely to come up.
Still, it does not hurt to be more careful.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1060-object-corruption.sh')
0 files changed, 0 insertions, 0 deletions