]> git.ipfire.org Git - thirdparty/git.git/commit - rerere.c
rerere: lift PATH_MAX limitation
authorJunio C Hamano <gitster@pobox.com>
Sun, 28 Jun 2015 22:51:59 +0000 (15:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Jul 2015 22:08:23 +0000 (15:08 -0700)
commitf5800f6ad8b8cbf41a252f7ca0ae465217174c60
tree2538a91b20650e583d6ccdb8d53d23abdaa3df83
parent8d9b5a4ada8b8e187af7dbdc7bc24f6ed774df80
rerere: lift PATH_MAX limitation

The MERGE_RR file records a collection of NUL-terminated entries,
each of which consists of

 - a hash that identifies the conflict
 - a HT
 - the pathname

We used to read this piece-by-piece, and worse yet, read the
pathname part a byte at a time into a fixed buffer of size PATH_MAX.

Instead, read a whole entry using strbuf_getwholeline() and parse
out the fields.  This way, we issue fewer read(2) calls and more
importantly we do not have to limit the pathname to PATH_MAX.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c