diff options
Diffstat (limited to 'vendor/code.gitea.io/git/commit.go')
-rw-r--r-- | vendor/code.gitea.io/git/commit.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vendor/code.gitea.io/git/commit.go b/vendor/code.gitea.io/git/commit.go index 28dd264835..0a95bc90b7 100644 --- a/vendor/code.gitea.io/git/commit.go +++ b/vendor/code.gitea.io/git/commit.go @@ -235,6 +235,9 @@ func (c *Commit) GetSubModules() (*ObjectCache, error) { entry, err := c.GetTreeEntryByPath(".gitmodules") if err != nil { + if _, ok := err.(ErrNotExist); ok { + return nil, nil + } return nil, err } rd, err := entry.Blob().Data() @@ -273,9 +276,11 @@ func (c *Commit) GetSubModule(entryname string) (*SubModule, error) { return nil, err } - module, has := modules.Get(entryname) - if has { - return module.(*SubModule), nil + if modules != nil { + module, has := modules.Get(entryname) + if has { + return module.(*SubModule), nil + } } return nil, nil } |