summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 43fe9e6d89..e90c59539b 100644
--- a/refs.c
+++ b/refs.c
@@ -2096,8 +2096,11 @@ static int run_transaction_hook(struct ref_transaction *transaction,
update->refname);
if (write_in_full(proc.in, buf.buf, buf.len) < 0) {
- if (errno != EPIPE)
+ if (errno != EPIPE) {
+ /* Don't leak errno outside this API */
+ errno = 0;
ret = -1;
+ }
break;
}
}