summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-08-06 22:31:10 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-08-06 22:31:10 -0700
commit4b7f2fa4c6c2c4675ab00474d419fa356afdfa71 (patch)
tree267252f14f92644fd5ea164149053c32accd62a5 /builtin
parentt/t5400: demonstrate breakage caused by informational message from prune (diff)
downloadtgif-4b7f2fa4c6c2c4675ab00474d419fa356afdfa71.tar.xz
receive-pack: do not leak output from auto-gc to standard output
The standard output channel of receive-pack is a structured protocol channel, and subprocesses must never be allowed to leak anything into it by writing to their standard output. Use RUN_COMMAND_STDOUT_TO_STDERR option to run_command_v_opt() just like we do when running hooks to prevent output from "gc" leaking to the standard output. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/receive-pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 0afb8b2896..3f05d971ec 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -977,7 +977,8 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
const char *argv_gc_auto[] = {
"gc", "--auto", "--quiet", NULL,
};
- run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+ int opt = RUN_GIT_CMD | RUN_COMMAND_STDOUT_TO_STDERR;
+ run_command_v_opt(argv_gc_auto, opt);
}
if (auto_update_server_info)
update_server_info(0);