Skip to content

Commit 8846020

Browse files
committed
Fix a few minor things
1 parent 50efc5d commit 8846020

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

cls/SourceControl/Git/Settings.cls

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,7 @@ Method %Save() As %Status
172172
set @storage@("settings","gitRemoteURL") = ..gitRemoteURL
173173
set @storage@("settings", "lockBranch") = ..lockBranch
174174

175-
if (..gitRemoteType = "HTTPS") {
176-
set @storage@("settings","OAuth") = ..OAuth
177-
} else {
178-
set @storage@("settings","OAuth") = 0
179-
}
175+
set @storage@("settings","OAuth") = ..OAuth
180176

181177
set @storage@("settings", "mappingsToken") = ..mappingsToken
182178

cls/SourceControl/Git/Utils.cls

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,10 @@ ClassMethod Clone(remote As %String) As %Status
690690
{
691691
set settings = ##class(SourceControl.Git.Settings).%New()
692692
// TODO: eventually use /ENV flag with GIT_TERMINAL_PROMPT=0. (This isn't doc'd yet and is only in really new versions.)
693-
set sc = ..RunGitWithArgs(.errStream, .outStream, "clone", remote, settings.namespaceTemp)
693+
set rc = ..RunGitWithArgs(.errStream, .outStream, "clone", remote, settings.namespaceTemp)
694+
if rc '= 0 {
695+
quit $$$ERROR($$$GeneralError, "Git clone failed: "_errStream.Read())
696+
}
694697
// can I substitute this with the new print method?
695698
$$$NewLineIfNonEmptyStream(errStream)
696699
while 'errStream.AtEnd {
@@ -1867,7 +1870,13 @@ ClassMethod RunGitWithArgs(Output errStream, Output outStream, args...) As %Inte
18671870

18681871
ClassMethod RunGitCommand(command As %String, Output errStream, Output outStream, args...) As %Integer
18691872
{
1870-
quit ..RunGitCommandWithInput(command,,.errStream,.outStream,args...)
1873+
try {
1874+
set rc = ..RunGitCommandWithInput(command, "", .errStream, .outStream, args...)
1875+
} catch ex {
1876+
set errStream = ex.DisplayString()
1877+
do ex.Log()
1878+
}
1879+
quit rc
18711880
}
18721881

18731882
ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", Output errStream, Output outStream, args...) As %Integer
@@ -2091,6 +2100,7 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
20912100
set env("GIT_TERMINAL_PROMPT") = 0
20922101
}
20932102
}
2103+
20942104
try {
20952105
// Inject instance manager directory as global git config home directory
20962106
// On Linux, this avoids trying to use /root/.config/git/attributes for global git config

csp/gitprojectsettings.csp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ body {
167167
}
168168

169169
// Set OAuth based on remote URL protocol and toggle state
170-
if ((remoteToCheck [ "https") && ($Get(%request.Data("OAuth"), 1) = 1) ) {
171-
set settings.OAuth = 1
172-
} else {
173-
set settings.OAuth = 0
174-
}
170+
set settings.OAuth = $Get(%request.Data("OAuth", 1), 0)
175171

176172
set settings.compileOnImport = ($Get(%request.Data("compileOnImport", 1)) = 1)
177173
set settings.decomposeProductions = ($Get(%request.Data("decomposeProductions", 1)) = 1)
@@ -212,7 +208,8 @@ body {
212208
if ($get(%request.Data("proxySubmitButton",1)) = "saveDefaults") {
213209
do settings.SaveDefaults()
214210
}
215-
do settings.%Save()
211+
$$$ThrowOnError(settings.%Save())
212+
216213
}
217214
set err = ""
218215
try {

module.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Version>2.12.2</Version>
77
<Description>Server-side source control extension for use of Git on InterSystems platforms</Description>
88
<Keywords>git source control studio vscode</Keywords>
9+
<GlobalScope>1</GlobalScope>
910
<Packaging>module</Packaging>
1011

1112
<!-- Extension source (classes/include) -->

0 commit comments

Comments
 (0)