Skip to content

Commit f43854c

Browse files
committed
Terminate git pull on error
1 parent ead95c8 commit f43854c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
- Make sure more fetch calls prune the remote branches (#471)
3131
- Force export of item if it has been modified (#354)
3232
- Production configuration page no longer closes Sync/WebUI when operations there change the production (#542)
33+
- Fixed sending OS error when git pull encounters error (#545)
3334

3435
## [2.6.0] - 2024-10-07
3536

cls/SourceControl/Git/API.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ ClassMethod Configure()
4444
}
4545

4646
/// API for git pull - just wraps Utils
47-
ClassMethod Pull()
47+
ClassMethod Pull(terminateOnError As %Boolean = 0)
4848
{
49-
quit ##class(SourceControl.Git.Utils).Pull()
49+
quit ##class(SourceControl.Git.Utils).Pull(,terminateOnError)
5050
}
5151

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

cls/SourceControl/Git/Utils.cls

Lines changed: 5 additions & 1 deletion
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") As %Status
613+
ClassMethod Pull(remote As %String = "origin", terminateOnError As %Boolean=0) As %Status
614614
{
615615
New %gitSCOutputFlag
616616
Set %gitSCOutputFlag = 1
@@ -625,6 +625,10 @@ ClassMethod Pull(remote As %String = "origin") As %Status
625625
write !
626626
do errStream.OutputToDevice()
627627
write !, "Pull ran with return code: " _ returnCode
628+
set err = errStream.Read()
629+
if $find(err,"error") && terminateOnError {
630+
quit $$$Error($$$GeneralError, err)
631+
}
628632
quit $$$OK
629633
}
630634

0 commit comments

Comments
 (0)