summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-06-27 16:56:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-06-27 16:56:52 (GMT)
commit8579c4ebee0257ac98eaecdb77077e3baa96d0c9 (patch)
tree3fca6f0b70f940580426f7cd9882291cab98bcd1 /builtin/receive-pack.c
parent3ec9150a8cff7ec2531e853b00407f40ca3624ab (diff)
parent860a2ebecd26563e6ac0f89c90052b41a17d1703 (diff)
downloadgit-8579c4ebee0257ac98eaecdb77077e3baa96d0c9.zip
git-8579c4ebee0257ac98eaecdb77077e3baa96d0c9.tar.gz
git-8579c4ebee0257ac98eaecdb77077e3baa96d0c9.tar.bz2
Merge branch 'lf/receive-pack-auto-gc-to-client'
Allow messages that are generated by auto gc during "git push" on the receiving end to be explicitly passed back to the sending end over sideband, so that they are shown with "remote: " prefix to avoid confusing the users. * lf/receive-pack-auto-gc-to-client: receive-pack: send auto-gc output over sideband 2
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r--builtin/receive-pack.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index a744437..15c323a 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1775,9 +1775,20 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
const char *argv_gc_auto[] = {
"gc", "--auto", "--quiet", NULL,
};
- int opt = RUN_GIT_CMD | RUN_COMMAND_STDOUT_TO_STDERR;
+ struct child_process proc = CHILD_PROCESS_INIT;
+
+ proc.no_stdin = 1;
+ proc.stdout_to_stderr = 1;
+ proc.err = use_sideband ? -1 : 0;
+ proc.git_cmd = 1;
+ proc.argv = argv_gc_auto;
+
close_all_packs();
- run_command_v_opt(argv_gc_auto, opt);
+ if (!start_command(&proc)) {
+ if (use_sideband)
+ copy_to_sideband(proc.err, -1, NULL);
+ finish_command(&proc);
+ }
}
if (auto_update_server_info)
update_server_info(0);