From 0ee662c03e6d0293715804ebedbd47e44f8f8ffd Mon Sep 17 00:00:00 2001 From: "j. mccann" Date: Fri, 21 Jun 2019 01:26:19 -0400 Subject: [PATCH] Fix Submodule dection in subdir 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 43723d169b7a5..9270878c7fcbb 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