You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies for not making a small reproducible example.
The new git commit info from Faster Commit Lookup #91 causes crashes when changing branches in gitea from the default branch.
In the file vendor/code.gitea.io/git/commit_info.go:
This is because the "git rev-list HEAD -- " uses the HEAD from the default branch. If the entryPath contains a file, or directory that is not present in the default branch - then the rev-list returns no files and this causes a crash.
I believe the line should be changed from:
command := NewCommand("rev-list", "-1", "HEAD", "--", entryPath)
to:
command := NewCommand("rev-list", "-1", state.headCommit.ID.String(), "--", entryPath)
Making this change seems to have fixed the issue for me
...
Screenshots
The text was updated successfully, but these errors were encountered:
[x]
):Description
Apologies for not making a small reproducible example.
The new git commit info from Faster Commit Lookup #91 causes crashes when changing branches in gitea from the default branch.
In the file vendor/code.gitea.io/git/commit_info.go:
This is because the "git rev-list HEAD -- " uses the HEAD from the default branch. If the entryPath contains a file, or directory that is not present in the default branch - then the rev-list returns no files and this causes a crash.
I believe the line should be changed from:
command := NewCommand("rev-list", "-1", "HEAD", "--", entryPath)
to:
command := NewCommand("rev-list", "-1", state.headCommit.ID.String(), "--", entryPath)
Making this change seems to have fixed the issue for me
...
Screenshots
The text was updated successfully, but these errors were encountered: