Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove git.Commit referenced Tree object to let it portable #35356

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
lunny wants to merge 11 commits into go-gitea:main
base: main
Choose a base branch
Loading
from lunny:lunny/remove_repo_ref_in_commit

Conversation

Copy link
Member

@lunny lunny commented Aug 25, 2025
edited
Loading

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
@lunny lunny requested a review from wxiaoguang August 27, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@wxiaoguang wxiaoguang Awaiting requested review from wxiaoguang

Assignees
No one assigned
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
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /