Skip to content

Commit

Permalink
Fix opening the blob view for new files
Browse files Browse the repository at this point in the history
Regression introduced in 935fdba.
  • Loading branch information
koutcher committed May 28, 2024
1 parent 935fdba commit 94cd7e1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,16 +652,9 @@ diff_trace_origin(struct view *view, enum request request, struct line *line)
return REQ_NONE;
}

for (; diff < line && !file; diff++) {
const char *data = box_text(diff);
file = diff_get_pathname(view, line, line->type == LINE_DIFF_DEL);

if (!prefixcmp(data, "--- a/")) {
file = data + STRING_SIZE("--- a/");
break;
}
}

if (diff == line || !file) {
if (!file) {
report("Failed to read the file name");
return REQ_NONE;
}
Expand Down

0 comments on commit 94cd7e1

Please sign in to comment.