mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix Submodule dection in subdir (#7275)
Include the directory in name when looking for matching Submodule from .gitmodules file Fixes #7262
This commit is contained in:
		@@ -37,7 +37,13 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache LastCom
 | 
				
			|||||||
			entryCommit := convertCommit(rev)
 | 
								entryCommit := convertCommit(rev)
 | 
				
			||||||
			if entry.IsSubModule() {
 | 
								if entry.IsSubModule() {
 | 
				
			||||||
				subModuleURL := ""
 | 
									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
 | 
										return nil, nil, err
 | 
				
			||||||
				} else if subModule != nil {
 | 
									} else if subModule != nil {
 | 
				
			||||||
					subModuleURL = subModule.URL
 | 
										subModuleURL = subModule.URL
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user