-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show all submodules recursively (#3341)
- **PR Description** Extend the submodules tab to show not only the top-level submodules, but also their nested submodules, recursively. Fixes #3306.
- Loading branch information
Showing
18 changed files
with
308 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,48 @@ | ||
package models | ||
|
||
import "path/filepath" | ||
|
||
type SubmoduleConfig struct { | ||
Name string | ||
Path string | ||
Url string | ||
|
||
ParentModule *SubmoduleConfig // nil if top-level | ||
} | ||
|
||
func (r *SubmoduleConfig) RefName() string { | ||
func (r *SubmoduleConfig) FullName() string { | ||
if r.ParentModule != nil { | ||
return r.ParentModule.FullName() + "/" + r.Name | ||
} | ||
|
||
return r.Name | ||
} | ||
|
||
func (r *SubmoduleConfig) FullPath() string { | ||
if r.ParentModule != nil { | ||
return r.ParentModule.FullPath() + "/" + r.Path | ||
} | ||
|
||
return r.Path | ||
} | ||
|
||
func (r *SubmoduleConfig) RefName() string { | ||
return r.FullName() | ||
} | ||
|
||
func (r *SubmoduleConfig) ID() string { | ||
return r.RefName() | ||
} | ||
|
||
func (r *SubmoduleConfig) Description() string { | ||
return r.RefName() | ||
} | ||
|
||
func (r *SubmoduleConfig) GitDirPath(repoGitDirPath string) string { | ||
parentPath := repoGitDirPath | ||
if r.ParentModule != nil { | ||
parentPath = r.ParentModule.GitDirPath(repoGitDirPath) | ||
} | ||
|
||
return filepath.Join(parentPath, "modules", r.Name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.