Skip to content

Commit dbbe026

Browse files
committed
Fixing terminate issue
1 parent 60deef3 commit dbbe026

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cls/SourceControl/Git/API.cls

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ ClassMethod Configure()
4444
}
4545

4646
/// API for git pull - just wraps Utils
47-
/// - terminateOnError: if set to 1, this will return an error if there are any errors in the pull, otherwise will return $$$OK
48-
ClassMethod Pull(terminateOnError As %Boolean = 0)
47+
/// - pTerminateOnError: if set to 1, this will terminate on error if there are any errors in the pull, otherwise will return status
48+
ClassMethod Pull(pTerminateOnError As %Boolean = 0)
4949
{
50-
quit ##class(SourceControl.Git.Utils).Pull(,terminateOnError)
50+
set st = ##class(SourceControl.Git.Utils).Pull(,pTerminateOnError)
51+
if pTerminateOnError && $$$ISERR(st) {
52+
Do $System.Process.Terminate($Job,1)
53+
}
54+
quit st
5155
}
5256

5357
/// Locks the environment to prevent changes to code other than through git pull.

cls/SourceControl/Git/Utils.cls

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

613-
ClassMethod Pull(remote As %String = "origin", terminateOnError As %Boolean=0) As %Status
613+
ClassMethod Pull(remote As %String = "origin", pTerminateOnError As %Boolean=0) As %Status
614614
{
615615
New %gitSCOutputFlag
616616
Set %gitSCOutputFlag = 1
@@ -626,7 +626,7 @@ ClassMethod Pull(remote As %String = "origin", terminateOnError As %Boolean=0) A
626626
do errStream.OutputToDevice()
627627
write !, "Pull ran with return code: " _ returnCode
628628
set err = errStream.Read()
629-
if $find(err,"error") && terminateOnError {
629+
if ($find(err,"error") || $find(err, "fatal")) && pTerminateOnError {
630630
quit $$$ERROR($$$GeneralError, err)
631631
}
632632
quit $$$OK

0 commit comments

Comments
 (0)