Skip to content

Commit a4e55dd

Browse files
committed
now also uses new strategy for pulls
1 parent cc328ac commit a4e55dd

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ ClassMethod Pull(remote As %String = "origin") As %Status
475475
set branchName = outStream.ReadLine(outStream.Size)
476476
write !, "Pulling from branch: ", branchName
477477
kill errStream, outStream
478-
set returnCode = ..RunGitWithArgs(.errStream, .outStream, "pull", remote _ "/" _ branchName)
478+
set returnCode = ..RunGitWithArgs(.errStream, .outStream, "pull", remote)
479479

480480
w !, "Pull ran with return code: " _ returnCode
481481
quit $$$OK
@@ -1534,10 +1534,6 @@ ClassMethod RunGitCommand(command As %String, Output errStream, Output outStream
15341534

15351535
ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", Output errStream, Output outStream, args...) As %Integer
15361536
{
1537-
set pullArg = ""
1538-
if command = "pull" {
1539-
set pullArg = args(1)
1540-
}
15411537
// Special case: git --version is used internally even when the settings incorporated here may be invalid/unspecified.
15421538
if (command '= "--version") {
15431539
set newArgs($increment(newArgs)) = "-C"
@@ -1569,11 +1565,11 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
15691565
set syncIrisWithCommand = 0 // // whether IRIS needs to be synced with repo file changes using command output
15701566
set diffBase = ""
15711567
set diffCompare = ""
1572-
set pullOriginIndex = ""
1573-
if (command = "checkout") || (command = "pull"){
1568+
1569+
if (command = "checkout"){
15741570
set syncIrisWithDiff = 1
15751571
set diffCompare = args(args)
1576-
} elseif (command = "merge") || (command = "rebase") {
1572+
} elseif (command = "merge") || (command = "rebase") || (command = "pull"){
15771573
set syncIrisWithCommand = 1
15781574
set diffCompare = args(args)
15791575
}
@@ -1582,24 +1578,18 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
15821578
for i=1:1:$get(args) {
15831579
if ($data(args(i))) {
15841580
set newArgs($increment(newArgs)) = args(i)
1585-
if newArgs(newArgs) = pullArg {
1586-
set pullOriginIndex = newArgs
1587-
}
1588-
if (args(i) = "checkout") || (args(i) = "pull"){
1581+
if (args(i) = "checkout") {
15891582
set syncIrisWithDiff = 1
15901583
set diffCompare = args(i + 1)
15911584

15921585
if args = (i + 2) {
15931586
set diffBase = args(i + 2)
15941587
}
1595-
} elseif (args(i) = "merge") || (args(i) = "rebase"){
1588+
} elseif (args(i) = "merge") || (args(i) = "rebase") || (args(i) = "pull") {
15961589
set syncIrisWithCommand = 1
15971590
set diffCompare = args(i + 1)
15981591
}
15991592

1600-
if (args(i) = "pull") {
1601-
set pullOriginIndex = i
1602-
}
16031593
}
16041594
}
16051595

@@ -1631,9 +1621,6 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
16311621
write !, ?4, modification.changeType, ?4, modification.internalName, ?4 , modification.externalName
16321622
}
16331623

1634-
if pullOriginIndex '= "" {
1635-
set newArgs(pullOriginIndex) = $piece(newArgs(pullOriginIndex), "/", 1)
1636-
}
16371624
}
16381625

16391626
set outLog = ##class(%Library.File).TempFilename()
@@ -1662,7 +1649,7 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
16621649
for stream=errStream,outStream {
16631650
set stream.RemoveOnClose = 1
16641651
}
1665-
// do ..PrintStreams(errStream, outStream)
1652+
do ..PrintStreams(errStream, outStream)
16661653
if syncIrisWithDiff {
16671654
$$$ThrowOnError(..SyncIrisWithRepoThroughDiff(.files))
16681655
} elseif syncIrisWithCommand {

0 commit comments

Comments
 (0)