From 94cd7e1a87b969916fc6657d2dbc294765f91fdf Mon Sep 17 00:00:00 2001 From: Thomas Koutcher Date: Tue, 28 May 2024 20:04:13 +0200 Subject: [PATCH] Fix opening the blob view for new files Regression introduced in 935fdbaa0ec6a182ab18016e0f3d0aa29bdf544b. --- src/diff.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/diff.c b/src/diff.c index f62336482..13c973d46 100644 --- a/src/diff.c +++ b/src/diff.c @@ -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; }