Skip to content

Conversation

lunny
Copy link
Member

@lunny lunny commented Sep 11, 2025

  • Use git fetch instead of git push to update the pull request head reference.
  • Removed HeadCommitID from the pull request struct to ensure the head commit ID is always read directly when needed, improving clarity.
  • Moved GetDivergingCommits to run after the head commit reference is created, so it no longer depends on the temporary repository. This also prepares for future refactors where temporary repository creation may be avoided.

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Sep 11, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 11, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Sep 11, 2025
@@ -214,35 +214,30 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
}
}

// Store old commit ID for review staleness checking
oldHeadCommitID := pr.HeadCommitID
Copy link
Member Author

Choose a reason for hiding this comment

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

line 190 have checked whether the old head commit id is the same as the new one.

@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Sep 12, 2025
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/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/migrations type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants