diff options
author | mrsdizzie <info@mrsdizzie.com> | 2019-06-21 02:13:54 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-06-21 14:13:53 +0800 |
commit | a25b3d4c725483a4203ba6f02021a494e2e05b3a (patch) | |
tree | bb6413d5fbf00dfb4cf4ae417a0ceb5ff04db6cd /modules | |
parent | 8db4541ecf626f43449d89f15a65ac530509d205 (diff) | |
download | gitea-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.go | 8 |
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 |