summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 33cff38cc0..c948d5215c 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -44,8 +44,7 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)
{
if (debug)
fprintf(stderr, "Debug: Remote helper: -> %s", buffer->buf);
- if (write_in_full(helper->helper->in, buffer->buf, buffer->len)
- != buffer->len)
+ if (write_in_full(helper->helper->in, buffer->buf, buffer->len) < 0)
die_errno("Full write to remote helper failed");
}
@@ -74,7 +73,7 @@ static void write_constant(int fd, const char *str)
{
if (debug)
fprintf(stderr, "Debug: Remote helper: -> %s", str);
- if (write_in_full(fd, str, strlen(str)) != strlen(str))
+ if (write_in_full(fd, str, strlen(str)) < 0)
die_errno("Full write to remote helper failed");
}
@@ -604,6 +603,7 @@ static int process_connect_service(struct transport *transport,
cmdbuf.buf);
exit:
+ strbuf_release(&cmdbuf);
fclose(input);
return ret;
}
@@ -927,7 +927,7 @@ static int push_refs_with_export(struct transport *transport,
struct object_id oid;
private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
- if (private && !get_sha1(private, oid.hash)) {
+ if (private && !get_oid(private, &oid)) {
strbuf_addf(&buf, "^%s", private);
string_list_append(&revlist_args, strbuf_detach(&buf, NULL));
oidcpy(&ref->old_oid, &oid);
@@ -1117,6 +1117,13 @@ int transport_helper_init(struct transport *transport, const char *name)
__attribute__((format (printf, 1, 2)))
static void transfer_debug(const char *fmt, ...)
{
+ /*
+ * NEEDSWORK: This function is sometimes used from multiple threads, and
+ * we end up using debug_enabled racily. That "should not matter" since
+ * we always write the same value, but it's still wrong. This function
+ * is listed in .tsan-suppressions for the time being.
+ */
+
va_list args;
char msgbuf[PBUFFERSIZE];
static int debug_enabled = -1;