From d0c35bcd58b013e2fe40ee92e6d4f413dd438576 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 18 Oct 2026 05:33:19 -0700 Subject: [PATCH] refactor(git): remove unused TreeCommon embedded struct (#39830) `TreeCommon` only holds `ID` and is embedded solely by `Tree`, with no other users. Inline the field into `Tree`; `t.ID` access is unchanged. Assisted-by: Codet:codet --- modules/git/tree.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/git/tree.go b/modules/git/tree.go index 3122a76a4f3..37f9a17b9d8 100644 --- a/modules/git/tree.go +++ b/modules/git/tree.go @@ -13,12 +13,8 @@ import ( "gitea.dev/modules/git/gitcmd" ) -type TreeCommon struct { - ID ObjectID -} - func newTree(id ObjectID) *Tree { - return &Tree{TreeCommon: TreeCommon{ID: id}} + return &Tree{ID: id} } // SubTree get a subtree by the sub dir path @@ -80,7 +76,7 @@ func (repo *Repository) GetTreePathLatestCommit(ctx context.Context, refName, tr // Tree represents a flat directory listing. type Tree struct { - TreeCommon + ID ObjectID entries Entries entriesParsed bool