提交 2c3766f0 编写于 作者: A Anders Melchiorsen 提交者: Junio C Hamano

Flush output in start_async

This prevents double output in case stdout is redirected.
Signed-off-by: NAnders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 22537765
......@@ -304,6 +304,9 @@ int start_async(struct async *async)
async->out = pipe_out[0];
#ifndef __MINGW32__
/* Flush stdio before fork() to avoid cloning buffers */
fflush(NULL);
async->pid = fork();
if (async->pid < 0) {
error("fork (async) failed: %s", strerror(errno));
......
......@@ -31,6 +31,12 @@ test_expect_success 'clone with excess parameters (2)' '
'
test_expect_success 'output from clone' '
rm -fr dst &&
git clone -n "file://$(pwd)/src" dst >output &&
test $(grep Initialized output | wc -l) = 1
'
test_expect_success 'clone does not keep pack' '
rm -fr dst &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册