diff: --full-index
[gitweb.git] / upload-pack.c
index 686445ec9b0a685e8325bb4d62abba90a6b3ad07..be63132804252e9a2f94ce1166ef9fa319a845fd 100644 (file)
@@ -212,17 +212,21 @@ static int receive_needs(void)
 
 static int send_ref(const char *refname, const unsigned char *sha1)
 {
-       static char *capabilities = "\0multi_ack";
+       static char *capabilities = "multi_ack";
        struct object *o = parse_object(sha1);
 
-       packet_write(1, "%s %s%s\n", sha1_to_hex(sha1), refname, capabilities);
-       capabilities = "";
+       if (capabilities)
+               packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname,
+                       0, capabilities);
+       else
+               packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
+       capabilities = NULL;
        if (!(o->flags & OUR_REF)) {
                o->flags |= OUR_REF;
                nr_our_refs++;
        }
        if (o->type == tag_type) {
-               o = deref_tag(o);
+               o = deref_tag(o, refname, 0);
                packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
        }
        return 0;