X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=server-info.c;h=ba5359108deb4f010be366ef65974ec7db123098;hb=b5c367f75c2990650119749a1add5216871ca47a;hp=a9e5607f2f5668411e5742243372bf570c2bda72;hpb=8ac93bc98f5e868e890e1a740df9f0c6513189c8;p=git.git diff --git a/server-info.c b/server-info.c index a9e5607f..ba535910 100644 --- a/server-info.c +++ b/server-info.c @@ -9,7 +9,14 @@ static FILE *info_ref_fp; static int add_info_ref(const char *path, const unsigned char *sha1) { + struct object *o = parse_object(sha1); + fprintf(info_ref_fp, "%s %s\n", sha1_to_hex(sha1), path); + if (o->type == tag_type) { + o = deref_tag(o); + fprintf(info_ref_fp, "%s %s^{}\n", + sha1_to_hex(o->sha1), path); + } return 0; } @@ -59,6 +66,16 @@ static struct object *parse_object_cheap(const unsigned char *sha1) struct commit *commit = (struct commit *)o; free(commit->buffer); commit->buffer = NULL; + } else if (o->type == tree_type) { + struct tree *tree = (struct tree *)o; + struct tree_entry_list *e, *n; + for (e = tree->entries; e; e = n) { + free(e->name); + e->name = NULL; + n = e->next; + free(e); + } + tree->entries = NULL; } return o; }