Skip to content

Commit c48e98c

Browse files
committed
Merge branch 'eb/cred-helper-ignore-sigpipe' into next
When credential helper exits very quickly without reading its input, it used to cause Git to die with SIGPIPE, which has been fixed. * eb/cred-helper-ignore-sigpipe: credential: ignore SIGPIPE when writing to credential helpers
2 parents 4f13731 + a0d51e8 commit c48e98c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

credential.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "run-command.h"
66
#include "url.h"
77
#include "prompt.h"
8+
#include "sigchain.h"
89

910
void credential_init(struct credential *c)
1011
{
@@ -227,8 +228,10 @@ static int run_credential_helper(struct credential *c,
227228
return -1;
228229

229230
fp = xfdopen(helper.in, "w");
231+
sigchain_push(SIGPIPE, SIG_IGN);
230232
credential_write(c, fp);
231233
fclose(fp);
234+
sigchain_pop(SIGPIPE);
232235

233236
if (want_output) {
234237
int r;

0 commit comments

Comments
 (0)