Skip to content

Commit 75a4fdb

Browse files
committed
Merge branch 'main' into hcc-docs-wip
2 parents 7346166 + 0c7721d commit 75a4fdb

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.7.1] - Unreleased
9+
10+
### Fixed
11+
- Fixed improper encoding of unicode characters in commit messages (#627)
12+
- Creating a new branch now reports the error if uncommitted changes conflict (#624)
13+
- Fix Configure erroring out if git isn't found (#632)
14+
815
## [2.7.0] - 2024-11-04
916

1017
### Added

cls/SourceControl/Git/API.cls

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ ClassMethod Configure()
1818
set gitExists = ##class(SourceControl.Git.Utils).GitBinExists(.version)
1919
set gitBinPath = ##class(SourceControl.Git.Utils).GitBinPath(.isDefault)
2020

21-
// Make sure they are using an appropriate git version
22-
if (+$PIECE(version,"version ",2))<2.31 {
23-
write !!, "WARNING: You are using an older version of git which is not compatible with git-source-control. Please upgrade to git version 2.31.0 or greater to continue"
24-
write !!, "Cancelling git-source-control configuration..."
25-
quit
26-
}
2721
if gitExists && isDefault {
2822
// Note: version starts with "git version"
2923
write !,version," is available via PATH. You may enter a path to a different version if needed."

cls/SourceControl/Git/Settings.cls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ ClassMethod Configure() As %Boolean [ CodeMode = objectgenerator ]
184184
do %code.WriteLine(" set status = inst.ConfigureBinPath(.value)")
185185
do %code.WriteLine(" if (status) { set valid = 1 }")
186186
do %code.WriteLine(" }")
187+
do %code.WriteLine(" set gitExists = ##class(SourceControl.Git.Utils).GitBinExists(.version)")
188+
do %code.WriteLine(" if (+$PIECE(version,""version "",2))<2.31 && gitExists{")
189+
do %code.WriteLine(" write !!, ""WARNING: You are using an older version of git which is not compatible with git-source-control. Please upgrade to git version 2.31.0 or greater to continue""")
190+
do %code.WriteLine(" write !!, ""Cancelling git-source-control configuration...""")
191+
do %code.WriteLine(" quit")
192+
do %code.WriteLine(" }")
187193
} elseif ((propertyDef) && (propertyDef.Name = "basicMode")) {
188194
set basicModePromptFlag = defaultPromptFlag + $$$MatchExactArrayMask + $$$InitialDisplayMask
189195
do %code.WriteLine(" set list(1) = ""Yes""")

cls/SourceControl/Git/Utils.cls

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ClassMethod TempFolder() As %String
4949

5050
ClassMethod DefaultTempFolder() As %String
5151
{
52-
quit $get(@..#Storage@("settings","namespaceTemp"),..DefaultTemp()_$translate($znspace,"%")_..#Slash)
52+
quit $get(@..#Storage@("settings","namespaceTemp"),..DefaultTemp()_..#Slash_$translate($znspace,"%")_..#Slash)
5353
}
5454

5555
ClassMethod MappingsNode() As %String [ CodeMode = expression ]
@@ -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

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,12 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
244244
}
245245
set handled = 1
246246
} elseif (pathStart = "git-command") {
247-
set requestBody = ##class(%Library.DynamicObject).%FromJSON(%request.Content)
247+
set stringBody = ""
248+
while '%request.Content.AtEnd {
249+
set stringBody = stringBody _ %request.Content.Read()
250+
}
251+
set stringBody = $zconvert(stringBody,"I","UTF8")
252+
set requestBody = ##class(%Library.DynamicObject).%FromJSON(stringBody)
248253
set command = requestBody.command
249254

250255
set gitCmd = command.%Get(0)

module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Document name="git-source-control.ZPM">
44
<Module>
55
<Name>git-source-control</Name>
6-
<Version>2.7.0</Version>
6+
<Version>2.7.1</Version>
77
<Description>Server-side source control extension for use of Git on InterSystems platforms</Description>
88
<Keywords>git source control studio vscode</Keywords>
99
<Packaging>module</Packaging>

0 commit comments

Comments
 (0)