]> git.ipfire.org Git - thirdparty/git.git/commit - rerere.c
rerere: return strbuf from handle path
authorThomas Gummerer <t.gummerer@gmail.com>
Sun, 5 Aug 2018 17:20:35 +0000 (18:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Aug 2018 20:22:35 +0000 (13:22 -0700)
commit5ebbdad3447ccaaf5af18a5f4f8f5065bd9fff3d
tree052d0931fcf25d799c9195ae2de90ae12939c6a0
parentc0f16f8e14432b9b6a1b21885080eab6388d887e
rerere: return strbuf from handle path

Currently we write the conflict to disk directly in the handle_path
function.  To make it re-usable for nested conflicts, instead of
writing the conflict out directly, store it in a strbuf and let the
caller write it out.

This does mean some slight increase in memory usage, however that
increase is limited to the size of the largest conflict we've
currently processed.  We already keep one copy of the conflict in
memory, and it shouldn't be too large, so the increase in memory usage
seems acceptable.

As a bonus this lets us get replace the rerere_io_putconflict function
with a trivial two line function.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c