Diff breaks if csv deleted from base and head #10285

Closed
opened 2025-11-02 09:03:13 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @kdumontnu on GitHub (Feb 17, 2023).

Description

Deleting a .csv file from both the base and head branch in a compare will result in a 500 error.

https://try.gitea.io/kdumontnu/test/compare/main...delete-csv

Gitea Version

d9c6cb71e

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Seen on 1.17 initially. Reproduced on try.gitea.

Database

None

Originally created by @kdumontnu on GitHub (Feb 17, 2023). ### Description Deleting a .csv file from both the base and head branch in a compare will result in a 500 error. https://try.gitea.io/kdumontnu/test/compare/main...delete-csv ### Gitea Version d9c6cb71e ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Seen on 1.17 initially. Reproduced on try.gitea. ### Database None
GiteaMirror added the type/bug label 2025-11-02 09:03:13 -06:00
Author
Owner

@lunny commented on GitHub (Feb 17, 2023):

2023/02/17 02:58:03 ...s/context/context.go:231:HTML() [E] [63eeed3b-8] Render failed: template: repo/diff/csv_diff:3:15: executing "repo/diff/csv_diff" at <call .root.CreateCsvDiff .file .blobBase .blobHead>: error calling call: runtime error: invalid memory address or nil pointer dereference
@lunny commented on GitHub (Feb 17, 2023): ```log 2023/02/17 02:58:03 ...s/context/context.go:231:HTML() [E] [63eeed3b-8] Render failed: template: repo/diff/csv_diff:3:15: executing "repo/diff/csv_diff" at <call .root.CreateCsvDiff .file .blobBase .blobHead>: error calling call: runtime error: invalid memory address or nil pointer dereference ```
Author
Owner

@wxiaoguang commented on GitHub (Feb 17, 2023):

Some contexts of this problem (just FYI):

@wxiaoguang commented on GitHub (Feb 17, 2023): Some contexts of this problem (just FYI): * Issue #19530 * PR #19552 * PR #21189
Author
Owner

@wxiaoguang commented on GitHub (Feb 17, 2023):

OK, I fully understand the problem now. If a CSV file is deleted from both branch, then baseReader and headReader can both be nil.

@wxiaoguang commented on GitHub (Feb 17, 2023): OK, I fully understand the problem now. If a CSV file is deleted from both branch, then baseReader and headReader can both be nil.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10285