From a25b3d4c725483a4203ba6f02021a494e2e05b3a Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Fri, 21 Jun 2019 02:13:54 -0400 Subject: [PATCH] Fix Submodule dection in subdir (#7275) Include the directory in name when looking for matching Submodule from .gitmodules file Fixes #7262 --- modules/git/commit_info.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/git/commit_info.go b/modules/git/commit_info.go index 43723d169b7a..9270878c7fcb 100644 --- a/modules/git/commit_info.go +++ b/modules/git/commit_info.go @@ -37,7 +37,13 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache LastCom entryCommit := convertCommit(rev) if entry.IsSubModule() { subModuleURL := "" - if subModule, err := commit.GetSubModule(entry.Name()); err != nil { + var fullPath string + if len(treePath) > 0 { + fullPath = treePath + "/" + entry.Name() + } else { + fullPath = entry.Name() + } + if subModule, err := commit.GetSubModule(fullPath); err != nil { return nil, nil, err } else if subModule != nil { subModuleURL = subModule.URL