X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=server-info.c;h=0cba8e19f7582fa5771ed6ab94a76e1d87efc53a;hb=17cf939724a244a56e687559fae062a3e6207145;hp=a9e5607f2f5668411e5742243372bf570c2bda72;hpb=8ac93bc98f5e868e890e1a740df9f0c6513189c8;p=git.git diff --git a/server-info.c b/server-info.c index a9e5607f..0cba8e19 100644 --- a/server-info.c +++ b/server-info.c @@ -9,7 +9,15 @@ 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, path, 0); + if (o) + fprintf(info_ref_fp, "%s %s^{}\n", + sha1_to_hex(o->sha1), path); + } return 0; } @@ -59,6 +67,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; }