Skip to content

Commit

Permalink
Restore blame for stash
Browse files Browse the repository at this point in the history
  • Loading branch information
koutcher committed Sep 15, 2021
1 parent 6c77c61 commit a74c738
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,13 +647,6 @@ diff_trace_origin(struct view *view, struct line *line)
struct blame_header header;
struct blame_commit commit;

if (!commit_line) {
report("Failed to read the commit ID");
return REQ_NONE;
}

string_copy_rev_from_commit_line(id, box_text(commit_line));

if (!diff || !chunk || chunk == line || diff < commit_line) {
report("The line to trace must be inside a diff chunk");
return REQ_NONE;
Expand Down Expand Up @@ -695,6 +688,11 @@ diff_trace_origin(struct view *view, struct line *line)
}
}

if (commit_line)
string_copy_rev_from_commit_line(id, box_text(commit_line));
else
string_copy(id, view->vid);

if (chunk_marker == '-')
string_format(ref, "%s^", id);
else
Expand Down

0 comments on commit a74c738

Please sign in to comment.