mirror of
https://github.com/go-gitea/git.git
synced 2026-02-05 06:45:03 +01:00
Fix regression causing no submodule info
This fixes regression introduced in ebd9fb2253,
that GetSubModules was always returning empty submodule info because
c.submoduleCache != nil check was always true since parseCommitData was setting
commit.submoduleCache = newObjectCache() so it was always not-nil.
Now we initialize submoduleCache in first GetSubModules call, next call will
return cached entries.
This commit is contained in:
@@ -195,6 +195,7 @@ func (c *Commit) GetSubModules() (*objectCache, error) {
|
||||
}
|
||||
|
||||
scanner := bufio.NewScanner(rd)
|
||||
c.submoduleCache = newObjectCache()
|
||||
var ismodule bool
|
||||
var path string
|
||||
for scanner.Scan() {
|
||||
|
||||
@@ -36,7 +36,6 @@ func (repo *Repository) GetTagCommitID(name string) (string, error) {
|
||||
// \n\n separate headers from message
|
||||
func parseCommitData(data []byte) (*Commit, error) {
|
||||
commit := new(Commit)
|
||||
commit.submoduleCache = newObjectCache()
|
||||
commit.parents = make([]sha1, 0, 1)
|
||||
// we now have the contents of the commit object. Let's investigate...
|
||||
nextline := 0
|
||||
|
||||
Reference in New Issue
Block a user