mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-24 01:24:39 +02:00
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
This commit is contained in:
1 parent
64846db075
commit
d0c35bcd58
1 file changed
+2
-6
+2
-6
@@ -13,12 +13,8 @@ import (
|
|||||||
"gitea.dev/modules/git/gitcmd"
|
"gitea.dev/modules/git/gitcmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TreeCommon struct {
|
|
||||||
ID ObjectID
|
|
||||||
}
|
|
||||||
|
|
||||||
func newTree(id ObjectID) *Tree {
|
func newTree(id ObjectID) *Tree {
|
||||||
return &Tree{TreeCommon: TreeCommon{ID: id}}
|
return &Tree{ID: id}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubTree get a subtree by the sub dir path
|
// 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.
|
// Tree represents a flat directory listing.
|
||||||
type Tree struct {
|
type Tree struct {
|
||||||
TreeCommon
|
ID ObjectID
|
||||||
|
|
||||||
entries Entries
|
entries Entries
|
||||||
entriesParsed bool
|
entriesParsed bool
|
||||||
|
|||||||
Reference in new issue
Block a user