Make sure the marks are not written out when the transport helper
did not finish happily, to avoid leaving a marks file that is out of
sync with the reality.
* fc/transport-helper-sync-error-fix:
t5801 (remote-helpers): cleanup environment sets
transport-helper: fix sync issue on crashes
transport-helper: trivial cleanup
transport-helper: propagate recvline() error pushing
remote-helpers: make recvline return an error
transport-helper: remove barely used xchgline()
} else if (starts_with(capname, "no-private-update")) {
data->no_private_update = 1;
} else if (mandatory) {
@ -307,7 +296,9 @@ static int set_helper_option(struct transport *transport,
@@ -307,7 +296,9 @@ static int set_helper_option(struct transport *transport,
quote_c_style(value, &buf, NULL, 0);
strbuf_addch(&buf, '\n');
xchgline(data, &buf);
sendline(data, &buf);
if (recvline(data, &buf))
exit(128);
if (!strcmp(buf.buf, "ok"))
ret = 0;
@ -379,7 +370,8 @@ static int fetch_with_fetch(struct transport *transport,
@@ -379,7 +370,8 @@ static int fetch_with_fetch(struct transport *transport,
sendline(data, &buf);
while (1) {
recvline(data, &buf);
if (recvline(data, &buf))
exit(128);
if (starts_with(buf.buf, "lock ")) {
const char *name = buf.buf + 5;
@ -430,6 +422,8 @@ static int get_exporter(struct transport *transport,
@@ -430,6 +422,8 @@ static int get_exporter(struct transport *transport,
@ -563,7 +561,9 @@ static int process_connect_service(struct transport *transport,
@@ -563,7 +561,9 @@ static int process_connect_service(struct transport *transport,
goto exit;
sendline(data, &cmdbuf);
recvline_fh(input, &cmdbuf, name);
if (recvline_fh(input, &cmdbuf, name))
exit(128);
if (!strcmp(cmdbuf.buf, "")) {
data->no_disconnect_req = 1;
if (debug)
@ -739,16 +739,22 @@ static int push_update_ref_status(struct strbuf *buf,
@@ -739,16 +739,22 @@ static int push_update_ref_status(struct strbuf *buf,
static int push_refs_with_push(struct transport *transport,
@ -846,8 +853,7 @@ static int push_refs_with_push(struct transport *transport,
@@ -846,8 +853,7 @@ static int push_refs_with_push(struct transport *transport,
static int push_refs_with_export(struct transport *transport,
@ -905,7 +911,15 @@ static int push_refs_with_export(struct transport *transport,
@@ -905,7 +911,15 @@ static int push_refs_with_export(struct transport *transport,