Skip to content

Commit 4f7e2f0

Browse files
committed
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
2 parents 6ba65f4 + d34182b commit 4f7e2f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/receive-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,10 +2550,12 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
25502550
&push_options);
25512551
if (pack_lockfile)
25522552
unlink_or_warn(pack_lockfile);
2553+
sigchain_push(SIGPIPE, SIG_IGN);
25532554
if (report_status_v2)
25542555
report_v2(commands, unpack_status);
25552556
else if (report_status)
25562557
report(commands, unpack_status);
2558+
sigchain_pop(SIGPIPE);
25572559
run_receive_hook(commands, "post-receive", 1,
25582560
&push_options);
25592561
run_update_post_hook(commands);

0 commit comments

Comments
 (0)