forked from kevadesu/forgejo
Merge pull request 'fix: return correct type in GetSubModule
' (#6114) from gusted/forgejo-submodule-entry into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6114 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
commit
45cec645de
4 changed files with 46 additions and 12 deletions
|
@ -211,12 +211,12 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
|
|||
contentsResponse.Target = &targetFromContent
|
||||
} else if entry.IsSubModule() {
|
||||
contentsResponse.Type = string(ContentTypeSubmodule)
|
||||
submodule, err := commit.GetSubModule(treePath)
|
||||
submoduleURL, err := commit.GetSubModule(treePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if submodule != nil && submodule.URL != "" {
|
||||
contentsResponse.SubmoduleGitURL = &submodule.URL
|
||||
if submoduleURL != "" {
|
||||
contentsResponse.SubmoduleGitURL = &submoduleURL
|
||||
}
|
||||
}
|
||||
// Handle links
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue