Skip to content

Commit 385e9a4

Browse files
author
Andrew McKnight
committed
add custom directory name parameter to clone command
1 parent 3bbaea3 commit 385e9a4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Sources/GitKit/Git.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public final class Git: Shell {
1818
case status(short: Bool = false)
1919
case commit(message: String, Bool = false)
2020
case config(name: String, value: String)
21-
case clone(url: String)
21+
case clone(url: String , dirName: String? = nil)
2222
case checkout(branch: String, create: Bool = false)
2323
case log(numberOfCommits: Int? = nil, options: [String]? = nil, revisions: String? = nil)
2424
case push(remote: String? = nil, branch: String? = nil)
@@ -57,8 +57,11 @@ public final class Git: Shell {
5757
if allowEmpty {
5858
params.append("--allow-empty")
5959
}
60-
case .clone(let url):
60+
case .clone(let url, let dirname):
6161
params = [Command.clone.rawValue, url]
62+
if let dirName = dirname {
63+
params.append(dirName)
64+
}
6265
case .checkout(let branch, let create):
6366
params = [Command.checkout.rawValue]
6467
if create {

0 commit comments

Comments
 (0)