Skip to content

Conversation

lunny
Copy link
Member

@lunny lunny commented Aug 25, 2025

This PR removes a flawed design where git.Commit depended on git.Tree, and git.Tree in turn depended on git.Repository.

Now, git.Commit only stores the TreeID as a field. To retrieve the tree of a commit, you can use NewTree.

This change makes git.Commit more portable, allowing commit objects to be transferred across machines when necessary.

  • Moved submoduleCache to Tree as field and rename CommitSubmoduleFile to SubmoduleFile

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Aug 25, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 25, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Aug 25, 2025
@lunny lunny marked this pull request as draft August 25, 2025 18:19
@lunny lunny force-pushed the lunny/remove_repo_ref_in_commit branch from fc59665 to 4a8637f Compare August 25, 2025 19:36
@lunny lunny changed the title Remove git.Commit referenced repo to let it portable Remove git.Commit referenced Tree object to let it portable Aug 25, 2025
@lunny lunny marked this pull request as ready for review August 26, 2025 03:28
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 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