pkt-line: add functions to read/write flush terminated packet streams
[gitweb.git] / builtin / receive-pack.c
index f1ce05ce282361d8c49b1a447db90c13d5186674..173d081647cc699bb17657176d730dc6b5139ea7 100644 (file)
@@ -224,7 +224,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
 static void show_ref(const char *path, const unsigned char *sha1)
 {
        if (sent_capabilities) {
-               packet_write(1, "%s %s\n", sha1_to_hex(sha1), path);
+               packet_write_fmt(1, "%s %s\n", sha1_to_hex(sha1), path);
        } else {
                struct strbuf cap = STRBUF_INIT;
 
@@ -239,7 +239,7 @@ static void show_ref(const char *path, const unsigned char *sha1)
                if (advertise_push_options)
                        strbuf_addstr(&cap, " push-options");
                strbuf_addf(&cap, " agent=%s", git_user_agent_sanitized());
-               packet_write(1, "%s %s%c%s\n",
+               packet_write_fmt(1, "%s %s%c%s\n",
                             sha1_to_hex(sha1), path, 0, cap.buf);
                strbuf_release(&cap);
                sent_capabilities = 1;