File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed
Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 " ] )
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -33,3 +33,7 @@ func touchFile(_ path: String) {
3333func runCommand( _ command: String ) {
3434 Git ( ) . runCommand ( command)
3535}
36+
37+ func testCommit( _ message: String ) {
38+ Git ( ) . runCommand ( " git commit -m \" \( message) \" --no-verify " )
39+ }
You can’t perform that action at this time.
0 commit comments