Skip to content

Commit 0c7721d

Browse files
authored
Merge pull request #633 from intersystems/issue-632
Fix git issue
2 parents 2db11a5 + 87c168e commit 0c7721d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111
- Fixed improper encoding of unicode characters in commit messages (#627)
1212
- Creating a new branch now reports the error if uncommitted changes conflict (#624)
13+
- Fix Configure erroring out if git isn't found (#632)
1314

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

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: 1 addition & 2 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 ]
@@ -2944,4 +2944,3 @@ ClassMethod InDefaultBranchBasicMode() As %Boolean
29442944
}
29452945

29462946
}
2947-

0 commit comments

Comments
 (0)