Skip to content

Commit

Permalink
Fix git-for-each-refs broken for tags
Browse files Browse the repository at this point in the history
Unfortunately, git-for-each-refs is currently unusable for peeking into tag
comments, since it uses freed pointers, so it just prints out all sort of
garbage.

This makes it strdup() contents and body values.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Nov 18, 2006
1 parent 6b1f8c3 commit f829063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin-for-each-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ static void grab_sub_body_contents(struct atom_value *val, int deref, struct obj
if (!strcmp(name, "subject"))
v->s = copy_line(subpos);
else if (!strcmp(name, "body"))
v->s = bodypos;
v->s = xstrdup(bodypos);
else if (!strcmp(name, "contents"))
v->s = subpos;
v->s = xstrdup(subpos);
}
}

Expand Down

0 comments on commit f829063

Please sign in to comment.