Skip to content

Fix t5570 flakiness on macOS #2111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,9 @@ static int fetch_one(struct remote *remote, int argc, const char **argv, int pru

sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack);
sigchain_push(SIGPIPE, SIG_IGN);
exit_code = do_fetch(gtransport, &rs);
sigchain_pop(SIGPIPE);
refspec_clear(&rs);
transport_disconnect(gtransport);
gtransport = NULL;
Expand Down
9 changes: 6 additions & 3 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ static void send_request(struct fetch_pack_args *args,
if (args->stateless_rpc) {
send_sideband(fd, -1, buf->buf, buf->len, LARGE_PACKET_MAX);
packet_flush(fd);
} else
write_or_die(fd, buf->buf, buf->len);
} else {
if (write_in_full(fd, buf->buf, buf->len) < 0)
die_errno(_("unable to write to remote"));
}
}

static void insert_one_alternate_object(struct fetch_negotiator *negotiator,
Expand Down Expand Up @@ -1178,7 +1180,8 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,

/* Send request */
packet_buf_flush(&req_buf);
write_or_die(fd_out, req_buf.buf, req_buf.len);
if (write_in_full(fd_out, req_buf.buf, req_buf.len) < 0)
die_errno(_("unable to write request to remote"));

strbuf_release(&req_buf);
return ret;
Expand Down
6 changes: 4 additions & 2 deletions pkt-line.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ static void packet_trace(const char *buf, unsigned int len, int write)
void packet_flush(int fd)
{
packet_trace("0000", 4, 1);
write_or_die(fd, "0000", 4);
if (write_in_full(fd, "0000", 4) < 0)
die_errno(_("unable to write flush packet"));
}

void packet_delim(int fd)
{
packet_trace("0001", 4, 1);
write_or_die(fd, "0001", 4);
if (write_in_full(fd, "0001", 4) < 0)
die_errno(_("unable to write delim packet"));
}

int packet_flush_gently(int fd)
Expand Down