summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-15 09:39:48 -0800
committerJunio C Hamano <gitster@pobox.com>2021-12-15 09:39:48 -0800
commit4f7e2f0b212132a1807448a170ddca1def234137 (patch)
tree9f25cc4f6558a31c371761167e65394db5150974
parent6ba65f4ac321d628d754b3e5494a348a2106c03a (diff)
parentd34182b9e37fc72e04e40e834775a1c29e80c970 (diff)
downloadgit-4f7e2f0b212132a1807448a170ddca1def234137.tar.gz
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);