Inherit submodules from template repository content (#16237)

Fix #10316

---------

Signed-off-by: Steffen Schröter <steffen@vexar.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Steffen Schröter 2025-01-01 03:55:13 +01:00 committed by GitHub
parent 92a2900a2d
commit 57eb9d0b64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 291 additions and 137 deletions

View file

@ -17,7 +17,7 @@ func NewTree(repo *Repository, id ObjectID) *Tree {
}
}
// SubTree get a sub tree by the sub dir path
// SubTree get a subtree by the sub dir path
func (t *Tree) SubTree(rpath string) (*Tree, error) {
if len(rpath) == 0 {
return t, nil
@ -63,7 +63,7 @@ func (repo *Repository) LsTree(ref string, filenames ...string) ([]string, error
return filelist, err
}
// GetTreePathLatestCommitID returns the latest commit of a tree path
// GetTreePathLatestCommit returns the latest commit of a tree path
func (repo *Repository) GetTreePathLatestCommit(refName, treePath string) (*Commit, error) {
stdout, _, err := NewCommand(repo.Ctx, "rev-list", "-1").
AddDynamicArguments(refName).AddDashesAndList(treePath).