summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/git_command_builder.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-03-07 20:20:42 +0100
committerGitHub <noreply@github.com>2024-03-07 20:20:42 +0100
commit44f553b6093c69d09718f617e0a7659c64f51015 (patch)
tree26216cd44d46ea6fcd21313541d39292c2c1b17e /pkg/commands/git_commands/git_command_builder.go
parentad017459d2d3475c18182c6629b6e282c5c558cb (diff)
parent3b723282cbe98063523e22f9dd71000d20dc5e20 (diff)
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.
Diffstat (limited to 'pkg/commands/git_commands/git_command_builder.go')
-rw-r--r--pkg/commands/git_commands/git_command_builder.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/commands/git_commands/git_command_builder.go b/pkg/commands/git_commands/git_command_builder.go
index 4aa35be5f..b6fe57364 100644
--- a/pkg/commands/git_commands/git_command_builder.go
+++ b/pkg/commands/git_commands/git_command_builder.go
@@ -60,6 +60,14 @@ func (self *GitCommandBuilder) Dir(path string) *GitCommandBuilder {
return self
}
+func (self *GitCommandBuilder) DirIf(condition bool, path string) *GitCommandBuilder {
+ if condition {
+ return self.Dir(path)
+ }
+
+ return self
+}
+
// Note, you may prefer to use the Dir method instead of this one
func (self *GitCommandBuilder) Worktree(path string) *GitCommandBuilder {
// worktree arg comes before the command