Fix: return correct type in GetSubModule
- `GetSubModules` already solely stores the URL of the submodule and not a `*SubModule` entry, so don't try to type assert it to be a struct. - I am not able to pinpoint when this was regressed but if I had to guess it might be #4941. - Added integration test.
This commit is contained in:
parent
fe246cc060
commit
e7cffc378f
4 changed files with 46 additions and 12 deletions
|
@ -72,17 +72,15 @@ func (tes Entries) GetCommitsInfo(ctx context.Context, commit *Commit, treePath
|
|||
|
||||
// If the entry if a submodule add a submodule file for this
|
||||
if entry.IsSubModule() {
|
||||
subModuleURL := ""
|
||||
var fullPath string
|
||||
if len(treePath) > 0 {
|
||||
fullPath = treePath + "/" + entry.Name()
|
||||
} else {
|
||||
fullPath = entry.Name()
|
||||
}
|
||||
if subModule, err := commit.GetSubModule(fullPath); err != nil {
|
||||
subModuleURL, err := commit.GetSubModule(fullPath)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
} else if subModule != nil {
|
||||
subModuleURL = subModule.URL
|
||||
}
|
||||
subModuleFile := NewSubModuleFile(commitsInfo[i].Commit, subModuleURL, entry.ID.String())
|
||||
commitsInfo[i].SubModuleFile = subModuleFile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue