Skip to content

Commit 0067981

Browse files
committed
attempting to capture output
1 parent d2d96a1 commit 0067981

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,10 +1767,34 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
17671767

17681768
if syncIrisWithDiff {
17691769
do ..PrintStreams(errStream, outStream)
1770-
$$$ThrowOnError(..SyncIrisWithRepoThroughDiff(.files, .filterToFiles, invert))
1770+
set buffer = ##class(SourceControl.Git.Util.Buffer).%New()
1771+
do buffer.BeginCaptureOutput()
1772+
set st = ..SyncIrisWithRepoThroughDiff(.files, .filterToFiles, invert)
1773+
do buffer.EndCaptureOutput(.out)
1774+
if $$$ISOK(st) {
1775+
while 'out.AtEnd {
1776+
do %outStream.WriteLine(out.ReadLine())
1777+
}
1778+
} else {
1779+
while 'out.AtEnd {
1780+
do %errStream.WriteLine(out.ReadLine())
1781+
}
1782+
}
17711783
} elseif syncIrisWithCommand {
17721784
do ..PrintStreams(errStream, outStream)
1773-
$$$ThrowOnError(..SyncIrisWithRepoThroughCommand(.outStream))
1785+
set buffer = ##class(SourceControl.Git.Util.Buffer).%New()
1786+
do buffer.BeginCaptureOutput()
1787+
set st = ..SyncIrisWithRepoThroughCommand(.outStream)
1788+
do buffer.EndCaptureOutput(.out)
1789+
if $$$ISOK(st) {
1790+
while 'out.AtEnd {
1791+
do %outStream.WriteLine(out.ReadLine())
1792+
}
1793+
} else {
1794+
while 'out.AtEnd {
1795+
do %errStream.WriteLine(out.ReadLine())
1796+
}
1797+
}
17741798
}
17751799
quit returnCode
17761800
}

0 commit comments

Comments
 (0)