Skip to content

Fix pull file view when single commit selected #35184

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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

badhezi
Copy link
Contributor

@badhezi badhezi commented Jul 30, 2025

attempt to address #35157

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 30, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jul 30, 2025
@badhezi badhezi marked this pull request as draft July 30, 2025 14:58
@badhezi badhezi marked this pull request as ready for review July 30, 2025 15:59
@lunny lunny added the type/bug label Jul 31, 2025
@@ -746,7 +746,24 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
WhitespaceBehavior: gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string)),
}

if !willShowSpecifiedCommit {
if willShowSpecifiedCommit {
// Attempt to extract parent of endCommit when viewing diff of a specific commit.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to move the logic to line 716

@lunny
Copy link
Member

lunny commented Aug 1, 2025

@badhezi I wasn’t able to push to this pull request, so I’ve opened a new one: #35192. Most of the changes were extracted from my previous PR #35077. Apologies for the conflicts, and thank you again for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants