]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: flush output buffer before printing error messages
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 1 Aug 2016 11:44:37 +0000 (13:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Aug 2016 18:45:27 +0000 (11:45 -0700)
commitbc9204d4ef6e0672389fdfb0d398fa9a39dba3d5
treef9bc87d443a40be32881e71828e6f7f9dde210b7
parent3f338f43b0eb8081660bbf694074a368cf07355e
merge-recursive: flush output buffer before printing error messages

The data structure passed to the recursive merge machinery has a feature
where the caller can ask for the output to be buffered into a strbuf, by
setting the field 'buffer_output'.

Previously, we died without flushing, losing accumulated output.  With
this patch, we show the output first, and only then print the error
message.

Currently, the only user of that buffering is merge_recursive() itself,
to avoid the progress output to interfere.

In the next patches, we will introduce a new buffer_output mode that
forces merge_recursive() to retain the output buffer for further
processing by the caller. If the caller asked for that, we will then
also write the error messages into the output buffer. This is necessary
to give the caller more control not only how to react in case of errors
but also control how/if to display the error messages.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c