summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2253776)
raw | patch | inline | side by side (parent: 2253776)
author | Anders Melchiorsen <mail@cup.kalibalik.dk> | |
Mon, 4 Aug 2008 00:30:03 +0000 (02:30 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 4 Aug 2008 00:55:40 +0000 (17:55 -0700) |
This prevents double output in case stdout is redirected.
Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c | patch | blob | history | |
t/t5601-clone.sh | patch | blob | history |
diff --git a/run-command.c b/run-command.c
index a3b28a64dc2d1b888b0ba2a135be10fe04651201..6af83c526ef8ddba7486457282e56093a9e3d0d4 100644 (file)
--- a/run-command.c
+++ b/run-command.c
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));
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 57173b4c50ec5f30198c9bf8bd8d03edd17bb235..a13b6f9d3d9c0735ce87c82150283727fab8e378 100755 (executable)
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
'
+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 &&