X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=upload-pack.c;h=be63132804252e9a2f94ce1166ef9fa319a845fd;hb=bb73d73c0885fce357e0d70aa51c2215a8e38a4e;hp=686445ec9b0a685e8325bb4d62abba90a6b3ad07;hpb=1bd8c8f00b1c7facb67c99047fe777b53f2c49ff;p=git.git diff --git a/upload-pack.c b/upload-pack.c index 686445ec..be631328 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -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;