diff --git a/commit.go b/commit.go index 9b89c62..acc12af 100644 --- a/commit.go +++ b/commit.go @@ -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() { diff --git a/repo_commit.go b/repo_commit.go index f808ea5..a653faf 100644 --- a/repo_commit.go +++ b/repo_commit.go @@ -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