Skip to content

Commit

Permalink
Merge branch 'eb/cred-helper-ignore-sigpipe'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Apr 11, 2018
2 parents 9b59d88 + a0d51e8 commit 7a94b26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "run-command.h"
#include "url.h"
#include "prompt.h"
#include "sigchain.h"

void credential_init(struct credential *c)
{
Expand Down Expand Up @@ -227,8 +228,10 @@ static int run_credential_helper(struct credential *c,
return -1;

fp = xfdopen(helper.in, "w");
sigchain_push(SIGPIPE, SIG_IGN);
credential_write(c, fp);
fclose(fp);
sigchain_pop(SIGPIPE);

if (want_output) {
int r;
Expand Down

0 comments on commit 7a94b26

Please sign in to comment.