cache: flush stdio before restoring FDs As described in commit 2efb59e (ui-patch: Flush stdout after outputting data, 2014-06-11), we need to ensure that stdout is flushed before restoring the file descriptor when writing to the cache. It turns out that it's not just ui-patch that is affected by this but also raw diff which writes to stdout internally. Let's avoid risking more places doing this by ensuring that stdout is flushed after writing in fill_slot(). Signed-off-by: John Keeping <john@keeping.me.uk>
John Keeping john@keeping.me.uk
Mon, 24 Apr 2017 19:38:34 +0100
2 files changed,
6 insertions(+),
2 deletions(-)
M
ui-patch.c
→
ui-patch.c
@@ -92,6 +92,4 @@ while ((commit = get_revision(&rev)) != NULL) {
log_tree_commit(&rev, commit); printf("-- \ncgit %s\n\n", cgit_version); } - - fflush(stdout); }