Skip to content

Commit 92cb559

Browse files
armcknightAndrew McKnight
andauthored
Add submodule foreach command (#10)
Co-authored-by: Andrew McKnight <git@mcknight.rocks>
1 parent bf9df68 commit 92cb559

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/GitKit/Git.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public final class Git: Shell {
2929
case tag(String)
3030
case fetch(remote: String? = nil, branch: String? = nil)
3131
case submoduleUpdate(init: Bool = false, recursive: Bool = false, rebase: Bool = false)
32+
case submoduleForeach(recursive: Bool = false, command: String)
3233
case renameRemote(oldName: String, newName: String)
3334
case addRemote(name: String, url: String)
3435
case revParse(abbrevRef: String)
@@ -122,6 +123,12 @@ public final class Git: Shell {
122123
if rebase {
123124
params.append("--rebase")
124125
}
126+
case .submoduleForeach(let recursive, let command):
127+
params = [Command.submodule.rawValue, "foreach"]
128+
if recursive {
129+
params.append("--recursive")
130+
}
131+
params.append(command)
125132
case .renameRemote(let oldName, let newName):
126133
params = [Command.remote.rawValue, "rename", oldName, newName]
127134
case .addRemote(let name, let url):

0 commit comments

Comments
 (0)