Skip to content

Commit 90c0853

Browse files
authored
Merge pull request #593 from intersystems/fix-592
fix: logging issues
2 parents 01ee816 + e6114d2 commit 90c0853

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ ClassMethod GetCurrentRevision() As %String
612612
quit revision
613613
}
614614

615-
ClassMethod Pull(remote As %String = "origin", pTerminateOnError As %Boolean=0) As %Status
615+
ClassMethod Pull(remote As %String = "origin", pTerminateOnError As %Boolean = 0) As %Status
616616
{
617617
New %gitSCOutputFlag
618618
Set %gitSCOutputFlag = 1
@@ -1924,7 +1924,9 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
19241924
}
19251925

19261926
if syncIrisWithDiff {
1927-
do ..PrintStreams(errStream, outStream)
1927+
if '$data(%gitSCOutputFlag)#2 {
1928+
do ..PrintStreams(errStream, outStream)
1929+
}
19281930
set buffer = ##class(SourceControl.Git.Util.Buffer).%New()
19291931
do buffer.BeginCaptureOutput()
19301932
set st = ..SyncIrisWithRepoThroughDiff(.files, .filterToFiles, invert)
@@ -2066,6 +2068,8 @@ ClassMethod ParseDiffStream(stream As %Stream.Object, verbose As %Boolean = 1, O
20662068
kill files
20672069
while (stream.AtEnd = 0) {
20682070
set file = stream.ReadLine()
2071+
continue:file=""
2072+
20692073
set modification = ##class(SourceControl.Git.Modification).%New()
20702074
set modification.changeType = $piece(file, $c(9), 1)
20712075

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,18 +223,19 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
223223
set %data = ##class(%Stream.TmpCharacter).%New()
224224
set changeTerminators = (%data.LineTerminator '= $char(13,10))
225225
set %data.LineTerminator = $char(13,10) // For the CSPGateway.
226+
do outStream.Rewind()
226227
while 'outStream.AtEnd {
227228
do %data.WriteLine(outStream.ReadLine())
228229
}
229230

230231
set nLines = 0
232+
do errStream.Rewind()
231233
while 'errStream.AtEnd {
232234
do %data.WriteLine(errStream.ReadLine())
233235
set:changeTerminators nLines = nLines + 1
234236
}
235237

236-
// Need to write out two lines or we get an infinite loop in JavaScript...
237-
do %data.WriteLine()
238+
// Need to write out an extra newline
238239
do %data.WriteLine()
239240
do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines))
240241
do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected
@@ -425,3 +426,4 @@ ClassMethod GetRemote() As %Library.DynamicObject
425426
}
426427

427428
}
429+

0 commit comments

Comments
 (0)