diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-06-27 19:56:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-27 19:56:52 +0300 |
commit | 8579c4ebee0257ac98eaecdb77077e3baa96d0c9 (patch) | |
tree | 3fca6f0b70f940580426f7cd9882291cab98bcd1 | |
parent | 3ec9150a8cff7ec2531e853b00407f40ca3624ab (diff) | |
parent | 860a2ebecd26563e6ac0f89c90052b41a17d1703 (diff) |
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
-rw-r--r-- | builtin/receive-pack.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index a744437b58..15c323a7cd 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); |