Skip to content

Commit

Permalink
Fix 'git show' on signed tag of signed tag of commit
Browse files Browse the repository at this point in the history
The cmd_show loop resolves tags by showing them, then pointing the
object to the 'tagged' member.  However, this object is not fully
initialized; it only contains the SHA1.  (This resulted in a segfault
if there were two levels of tags.)  We apply parse_object to get a
full object.

Noticed by Kalle Olavi Niemitalo on IRC.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Jul 2, 2008
1 parent a0d2ceb commit 4f3dcc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
t->tag,
diff_get_color_opt(&rev.diffopt, DIFF_RESET));
ret = show_object(o->sha1, 1, &rev);
objects[i].item = (struct object *)t->tagged;
objects[i].item = parse_object(t->tagged->sha1);
i--;
break;
}
Expand Down

0 comments on commit 4f3dcc2

Please sign in to comment.