-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files are viewed on too new commits #24813
Comments
I just checked this on my local machine and on gitea.com - for both 1.20 versions the headcommit is set. I've checked this PR: https://gitea.com/xorm/xorm/pulls/2241/files |
Now I'm confused… For me, it still isn't set for a private repo under my own user. Could it be that (private?) user repos have this problem? |
Which repositories could you paste here as an example? |
Well… I've just published my previously private test repo on gitea.com where I can reproduce this issue: |
Steps to reproduce:
|
@delvh Looks like the context variable "PullHeadCommitID" is not set. https://github.com/go-gitea/gitea/blob/main/templates/repo/diff/box.tmpl#L150 |
the PullHeadCommitID is not always available when the PR is merged. Not sure if this is the best solution but in my simple tests it looks like this fixes the problem - happy to get any feedback. hopefully fixes #24813
) the PullHeadCommitID is not always available when the PR is merged. Not sure if this is the best solution but in my simple tests it looks like this fixes the problem - happy to get any feedback. hopefully fixes go-gitea#24813
…5612) Backport #25529 by @sebastian-sauer the PullHeadCommitID is not always available when the PR is merged. Not sure if this is the best solution but in my simple tests it looks like this fixes the problem - happy to get any feedback. hopefully fixes #24813 Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
Description
Apparently, the
I've viewed this file
implementation is half broken now.It's still working without complaint because it's "dangling on a single thread that hasn't been destroyed yet":
I've put in a safe-guard that apparently is the only reason it's still working:
gitea/routers/web/repo/pull_review.go
Lines 277 to 279 in f5ce2ed
For some reason, the
head commit SHA
isn't set (anymore?), so reviews always get assigned to the newest commit which isn't necessarily the commit someone has reviewed (in case they had their tab open for long enough that other commits were pushed)I've traced this bug back to
gitea/templates/repo/diff/box.tmpl
Line 142 in f5ce2ed
as apparently
PullHeadCommitID
is empty/not present.However, I have no idea why this would be the case or if it has always been that way, and simply no one noticed.
(I doubt it, I remember testing the whole functionality, and I would have probably noticed it if the head-commit was always empty)
Gitea Version
1.20.0+dev-833-g040970c32
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?
try.gitea.io/ gitea.com and from compiled from source
Database
None
The text was updated successfully, but these errors were encountered: