aboutsummaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-12-01 17:19:52 -0500
committerJeff King <peff@peff.net>2015-12-01 17:19:52 -0500
commit347acea06a80324c7a184a856b5dac24d0ba2c92 (patch)
tree5414208483e8988f5c892fedf549f9173dd517c5 /builtin/commit.c
parent45e330f512b5a32f2e3aae800e57b07fd75f607e (diff)
parentaf65f68cdf7540764583956e5819d85c5f6c74d1 (diff)
downloadgit-347acea06a80324c7a184a856b5dac24d0ba2c92.tar.gz
git-347acea06a80324c7a184a856b5dac24d0ba2c92.tar.xz
Merge branch 'cb/hook-sigpipe' into maint
We now consistently allow all hooks to ignore their standard input, rather than having git complain of SIGPIPE. * cb/hook-sigpipe: allow hooks to ignore their standard input stream
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index dca09e2c3..f2a8b78c7 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -32,6 +32,7 @@
#include "sequencer.h"
#include "notes-utils.h"
#include "mailmap.h"
+#include "sigchain.h"
static const char * const builtin_commit_usage[] = {
N_("git commit [<options>] [--] <pathspec>..."),
@@ -1537,8 +1538,10 @@ static int run_rewrite_hook(const unsigned char *oldsha1,
return code;
n = snprintf(buf, sizeof(buf), "%s %s\n",
sha1_to_hex(oldsha1), sha1_to_hex(newsha1));
+ sigchain_push(SIGPIPE, SIG_IGN);
write_in_full(proc.in, buf, n);
close(proc.in);
+ sigchain_pop(SIGPIPE);
return finish_command(&proc);
}