diff options
| author | Jeff King <peff@peff.net> | 2015-12-01 17:19:52 -0500 |
|---|---|---|
| committer | Jeff King <peff@peff.net> | 2015-12-01 17:19:52 -0500 |
| commit | 347acea06a80324c7a184a856b5dac24d0ba2c92 (patch) | |
| tree | 5414208483e8988f5c892fedf549f9173dd517c5 /builtin/commit.c | |
| parent | Merge branch 'fm/shell-path-whitespace' into maint (diff) | |
| parent | allow hooks to ignore their standard input stream (diff) | |
| download | git-347acea06a80324c7a184a856b5dac24d0ba2c92.tar.gz git-347acea06a80324c7a184a856b5dac24d0ba2c92.zip | |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index dca09e2c3b..f2a8b78c7a 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); } |
