Skip to content

Commit b63c17d

Browse files
mrsdizziejeffliu27
authored andcommitted
Fix Submodule dection in subdir (go-gitea#7275)
Include the directory in name when looking for matching Submodule from .gitmodules file Fixes go-gitea#7262
1 parent 334ff2e commit b63c17d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/git/commit_info.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache LastCom
3737
entryCommit := convertCommit(rev)
3838
if entry.IsSubModule() {
3939
subModuleURL := ""
40-
if subModule, err := commit.GetSubModule(entry.Name()); err != nil {
40+
var fullPath string
41+
if len(treePath) > 0 {
42+
fullPath = treePath + "/" + entry.Name()
43+
} else {
44+
fullPath = entry.Name()
45+
}
46+
if subModule, err := commit.GetSubModule(fullPath); err != nil {
4147
return nil, nil, err
4248
} else if subModule != nil {
4349
subModuleURL = subModule.URL

0 commit comments

Comments
 (0)