@@ -319,6 +319,7 @@ ClassMethod UserAction(InternalName As %String, MenuName As %String, ByRef Targe
319
319
320
320
ClassMethod AfterUserAction (Type As %Integer , Name As %String , InternalName As %String , Answer As %Integer , Msg As %String = " " , ByRef Reload As %Boolean ) As %Status
321
321
{
322
+ set status = $$$OK
322
323
#dim menuName as %String = $piece (Name ," ," )
323
324
#dim menuItemName as %String = $piece (Name ," ," ,2 )
324
325
if (menuItemName = " Revert" ) || (menuItemName [ " Import" ) {
@@ -331,15 +332,12 @@ ClassMethod AfterUserAction(Type As %Integer, Name As %String, InternalName As %
331
332
}
332
333
} elseif (menuItemName = " NewBranch" ) {
333
334
if (Answer = 1 ) {
334
- do ..NewBranch (Msg )
335
+ set status = ..NewBranch (Msg )
335
336
set Reload = 1
336
337
}
337
338
} elseif (menuItemName = " SwitchBranch" ) {
338
339
if (Answer = 1 ) {
339
340
set status = ..SwitchBranch (Msg )
340
- if $$$ISERR(status ) {
341
- Quit status
342
- }
343
341
set Reload = 1
344
342
}
345
343
} elseif (menuItemName = " Sync" ) {
@@ -356,7 +354,7 @@ ClassMethod AfterUserAction(Type As %Integer, Name As %String, InternalName As %
356
354
// Always force reload as many things could have possibly changed.
357
355
set Reload = 1
358
356
}
359
- quit $$$OK
357
+ quit status
360
358
}
361
359
362
360
ClassMethod Init () As %Status
@@ -405,8 +403,12 @@ ClassMethod NewBranch(newBranchName As %String) As %Status
405
403
kill errStream , outStream
406
404
}
407
405
408
- do ..RunGitWithArgs (.errStream , .outStream , " checkout" , " -b" , newBranchName )
406
+ set err = ..RunGitWithArgs (.errStream , .outStream , " checkout" , " -b" , newBranchName )
409
407
do ..PrintStreams (errStream , outStream )
408
+ if err {
409
+ do errStream .Rewind ()
410
+ quit $$$ERROR($$$GeneralError,errStream .Read ()_$c (10 )_" Current branch is: " _..GetCurrentBranch ())
411
+ }
410
412
quit $$$OK
411
413
}
412
414
0 commit comments