summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-12-15 09:39:48 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-12-15 09:39:48 -0800
commit4f7e2f0b212132a1807448a170ddca1def234137 (patch)
tree9f25cc4f6558a31c371761167e65394db5150974
parentMerge branch 'es/pretty-describe-more' (diff)
parentreceive-pack: ignore SIGPIPE while reporting status to client (diff)
downloadtgif-4f7e2f0b212132a1807448a170ddca1def234137.tar.xz
Merge branch 'rj/receive-pack-avoid-sigpipe-during-status-reporting'
When the "git push" command is killed while the receiving end is trying to report what happened to the ref update proposals, the latter used to die, due to SIGPIPE. The code now ignores SIGPIPE to increase our chances to run the post-receive hook after it happens. * rj/receive-pack-avoid-sigpipe-during-status-reporting: receive-pack: ignore SIGPIPE while reporting status to client
-rw-r--r--builtin/receive-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 3979752cec..313b372a11 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2550,10 +2550,12 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
&push_options);
if (pack_lockfile)
unlink_or_warn(pack_lockfile);
+ sigchain_push(SIGPIPE, SIG_IGN);
if (report_status_v2)
report_v2(commands, unpack_status);
else if (report_status)
report(commands, unpack_status);
+ sigchain_pop(SIGPIPE);
run_receive_hook(commands, "post-receive", 1,
&push_options);
run_update_post_hook(commands);