Skip to content

Commit e717c53

Browse files
author
Brandon Sneed
committed
Merge branch 'master' of github.com:modulo-dm/modulo
2 parents 1fdb898 + 6818e68 commit e717c53

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

ModuloKit/SCM/Git.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ open class Git: SCM {
100100
let initialWorkingPath = FileManager.workingPath()
101101
FileManager.setWorkingPath(path)
102102

103-
let updateCommand = "git fetch --all --tags"
103+
let updateCommand = "git fetch --recurse-submodules --all --tags"
104104
let status = runCommand(updateCommand)
105105

106106
FileManager.setWorkingPath(initialWorkingPath)
@@ -120,7 +120,7 @@ open class Git: SCM {
120120
let initialWorkingPath = FileManager.workingPath()
121121
FileManager.setWorkingPath(path)
122122

123-
var updateCommand = "git pull --ff-only"
123+
var updateCommand = "git pull --recurse-submodules --ff-only"
124124
if let remote = remoteData {
125125
updateCommand = updateCommand + " \(remote)"
126126
}
@@ -161,13 +161,14 @@ open class Git: SCM {
161161

162162
let status = runCommand(checkoutCommand)
163163

164+
let submodulesResult = collectAnySubmodules()
165+
164166
FileManager.setWorkingPath(initialWorkingPath)
165167

166168
if status != 0 {
167169
return .error(code: status, message: "Unable to checkout a match for '\(version.original)'.")
168170
}
169171

170-
let submodulesResult = collectAnySubmodules()
171172
if submodulesResult != .success {
172173
return submodulesResult
173174
}

ModuloKitTests/TestScenarios.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class TestScenarios: XCTestCase {
6060
XCTAssertTrue(result == .success)
6161

6262
runCommand("git add -A")
63-
runCommand("git commit -m \"initial with modulo adds\"")
63+
testCommit("initial with modulo adds")
6464

6565
// the main project should be clean now.
6666
result = Modulo.run(["status"])
@@ -103,7 +103,7 @@ class TestScenarios: XCTestCase {
103103
XCTAssertTrue(result == .success)
104104

105105
runCommand("git add -A")
106-
runCommand("git commit -m \"initial with modulo adds\"")
106+
testCommit("initial with modulo adds")
107107

108108
// the main project should have unpushed commits now.
109109
result = Modulo.run(["status"])

ModuloKitTests/TestStatus.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TestStatus: XCTestCase {
7575

7676
touchFile("blah.txt")
7777
runCommand("git add blah.txt")
78-
runCommand("git commit -m \"test\"")
78+
testCommit("test")
7979

8080
result = Modulo.run(["status", "-v"])
8181
XCTAssertTrue(result == .dependencyUnclean)
@@ -98,7 +98,7 @@ class TestStatus: XCTestCase {
9898

9999
touchFile("blah.txt")
100100
runCommand("git add blah.txt")
101-
runCommand("git commit -m \"test\"")
101+
testCommit("test")
102102

103103
FileManager.setWorkingPath("../test-add")
104104

ModuloKitTests/Utils.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ func touchFile(_ path: String) {
3333
func runCommand(_ command: String) {
3434
Git().runCommand(command)
3535
}
36+
37+
func testCommit(_ message: String) {
38+
Git().runCommand("git commit -m \"\(message)\" --no-verify")
39+
}

0 commit comments

Comments
 (0)