Skip to content

Commit a97f823

Browse files
authored
Merge branch 'main' into commit-encoding
2 parents 4cb7803 + 659a268 commit a97f823

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Fixed improper encoding of unicode characters in commit messages (#627)
12+
- Creating a new branch now reports the error if uncommitted changes conflict (#624)
1213

1314
## [2.7.0] - 2024-11-04
1415

cls/SourceControl/Git/Utils.cls

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,17 @@ ClassMethod NewBranch(newBranchName As %String) As %Status
395395
{
396396
set settings = ##class(SourceControl.Git.Settings).%New()
397397
if (settings.basicMode) && (settings.defaultMergeBranch '= ""){
398-
do ..RunGitWithArgs(.errStream, .outStream, "checkout", settings.defaultMergeBranch)
398+
set err = ..RunGitWithArgs(.errStream, .outStream, "checkout", settings.defaultMergeBranch)
399399
do ..PrintStreams(errStream, outStream)
400+
if (err) {
401+
quit $$$ERROR($$$GeneralError,errStream.Read()_$c(10)_"Current branch is: "_..GetCurrentBranch())
402+
}
400403
kill errStream, outStream
401-
do ..RunGitWithArgs(.errStream, .outStream, "pull")
404+
set err = ..RunGitWithArgs(.errStream, .outStream, "pull")
402405
do ..PrintStreams(errStream, outStream)
406+
if (err) {
407+
quit $$$ERROR($$$GeneralError,errStream.Read()_$c(10)_"Current branch is: "_..GetCurrentBranch())
408+
}
403409
kill errStream, outStream
404410
}
405411

@@ -2938,3 +2944,4 @@ ClassMethod InDefaultBranchBasicMode() As %Boolean
29382944
}
29392945

29402946
}
2947+

0 commit comments

Comments
 (0)