mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-01 21:04:20 +00:00
refactor: remove Path field from git.Repository (#38552)
The "path" details should be hidden to other packages By the way, fix a resource leaking in gogit's CommitNodeIndex (the file was not closed in CacheCommit)
This commit is contained in:
@@ -153,10 +153,8 @@ func getLastCommitForPathsByCache(ctx context.Context, commitID, treePath string
|
||||
|
||||
// GetLastCommitForPaths returns last commit information
|
||||
func GetLastCommitForPaths(ctx context.Context, gitRepo *Repository, commit *Commit, treePath string, paths []string) (map[string]*Commit, error) {
|
||||
commitNodeIndex, commitGraphFile := gitRepo.CommitNodeIndex()
|
||||
if commitGraphFile != nil {
|
||||
defer commitGraphFile.Close()
|
||||
}
|
||||
commitNodeIndex, closer := gitRepo.CommitNodeIndex()
|
||||
defer closer()
|
||||
|
||||
c, err := commitNodeIndex.Get(plumbing.Hash(commit.ID.RawValue()))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user