summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-06-21 02:13:54 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2019-06-21 14:13:53 +0800
commita25b3d4c725483a4203ba6f02021a494e2e05b3a (patch)
treebb6413d5fbf00dfb4cf4ae417a0ceb5ff04db6cd /modules
parent8db4541ecf626f43449d89f15a65ac530509d205 (diff)
downloadgitea-a25b3d4c725483a4203ba6f02021a494e2e05b3a.tar.gz
gitea-a25b3d4c725483a4203ba6f02021a494e2e05b3a.zip
Fix Submodule dection in subdir (#7275)
Include the directory in name when looking for matching Submodule from .gitmodules file Fixes #7262
Diffstat (limited to 'modules')
-rw-r--r--modules/git/commit_info.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/git/commit_info.go b/modules/git/commit_info.go
index 43723d169b..9270878c7f 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