Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Blame the previous revision under its own name
Diffstat (limited to 'source')
| -rw-r--r-- | source/ui-blame.c | 10 |
1 file changed, 6 insertions, 4 deletions
diff --git a/source/ui-blame.c b/source/ui-blame.c index eef8602..46d1654 100644 --- a/source/ui-blame.c +++ b/source/ui-blame.c @@ -127,6 +127,7 @@ static char *suspect_detail(struct blame_origin *suspect) static void emit_entry_hash(struct blame_entry *ent) { struct blame_origin *suspect = ent->suspect; + struct blame_origin *previous = suspect->previous; struct object_id *oid = &suspect->commit->object.oid; const char *detail = suspect_detail(suspect); @@ -137,13 +138,14 @@ static void emit_entry_hash(struct blame_entry *ent) ); html("</span>"); - if (!repo_parse_commit(the_repository, suspect->commit) && suspect->commit->parents) { - struct commit *parent = suspect->commit->parents->item; - + // git records the parent along with the path the file had there, + // which a rename changes, and records none for the commit that + // created the file. + if (previous) { html(" "); cgit_blame_link( "^", "Blame the previous revision", NULL, ctx.qry.head, - oid_to_hex(&parent->object.oid), suspect->path + oid_to_hex(&previous->commit->object.oid), previous->path ); } |
