diff options
author | Jeff King <peff@peff.net> | 2015-12-01 17:32:38 -0500 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-12-01 17:32:38 -0500 |
commit | 40fdcc535783f5c64e6aba9f4b2d2c8997c55a8d (patch) | |
tree | 95a2da48eec35b7bfacf36beb80b05dcea84d6e1 /transport.c | |
parent | 1bc8feaa7cc752fe3b902ccf83ae9332e40921db (diff) | |
parent | 908a6e4156dff47d4877478383fd4b79592010e2 (diff) | |
download | git-40fdcc535783f5c64e6aba9f4b2d2c8997c55a8d.tar.gz |
Merge branch 'maint'
* maint:
http: treat config options sslCAPath and sslCAInfo as paths
Documentation/diff: give --word-diff-regex=. example
filter-branch: deal with object name vs. pathname ambiguity in tree-filter
check-ignore: correct documentation about output
git-p4: clean up after p4 submit failure
git-p4: work with a detached head
git-p4: add option to system() to return subshell status
git-p4: add failing test for submit from detached head
remote-http(s): support SOCKS proxies
t5813: avoid creating urls that break on cygwin
Escape Git's exec path in contrib/rerere-train.sh script
allow hooks to ignore their standard input stream
rebase-i-exec: Allow space in SHELL_PATH
Documentation: make environment variable formatting more consistent
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/transport.c b/transport.c index 23b2ed6f0c..e34ab92972 100644 --- a/transport.c +++ b/transport.c @@ -15,6 +15,7 @@ #include "submodule.h" #include "string-list.h" #include "sha1-array.h" +#include "sigchain.h" /* rsync support */ @@ -1127,6 +1128,8 @@ static int run_pre_push_hook(struct transport *transport, return -1; } + sigchain_push(SIGPIPE, SIG_IGN); + strbuf_init(&buf, 256); for (r = remote_refs; r; r = r->next) { @@ -1140,8 +1143,10 @@ static int run_pre_push_hook(struct transport *transport, r->peer_ref->name, sha1_to_hex(r->new_sha1), r->name, sha1_to_hex(r->old_sha1)); - if (write_in_full(proc.in, buf.buf, buf.len) != buf.len) { - ret = -1; + if (write_in_full(proc.in, buf.buf, buf.len) < 0) { + /* We do not mind if a hook does not read all refs. */ + if (errno != EPIPE) + ret = -1; break; } } @@ -1152,6 +1157,8 @@ static int run_pre_push_hook(struct transport *transport, if (!ret) ret = x; + sigchain_pop(SIGPIPE); + x = finish_command(&proc); if (!ret) ret = x; |