Skip to content

Commit c7ec05c

Browse files
committed
Initialize uses entered repo
1 parent afe2a42 commit c7ec05c

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535
- Fix branches with special characters not showing in GitUI (#523)
3636
- Fix filenames with spaces not showing correctly in workspace view (#551)
3737
- Removed inaccurate placeholder text for commit message in UI (#406)
38+
- Initialize repo in settings page now uses entered repo (#486)
3839

3940
## [2.6.0] - 2024-10-07
4041

cls/_zpkg/isc/sc/git/Socket.cls

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ ClassMethod Run()
2525
} ElseIf %request.Get("method") = "pull" {
2626
Do ##class(SourceControl.Git.API).Pull()
2727
} ElseIf %request.Get("method") = "init" {
28+
set root = %request.Get("root")
29+
30+
// Use user input if provided
31+
if (root '= "") && ($extract(root,1,3) '= "e.g") {
32+
set settings = ##class(SourceControl.Git.Settings).%New()
33+
set settings.namespaceTemp = root
34+
$$$ThrowOnError(settings.%Save())
35+
if ($extract(root, $length(root)) = "\") || ($extract(root, $length(root)) = "/") {
36+
set root = $extract(root, 1, $length(root) - 1)
37+
}
38+
set root = $translate(root, "\", "/")
39+
do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("config",,,,"--global", "--add", "safe.directory", root)
40+
}
41+
2842
Do ##class(SourceControl.Git.Utils).Init()
2943
Write !,"Done."
3044
} ElseIf %request.Get("method") = "clone" {

csp/gitprojectsettings.csp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ function getSocket(urlPostfix) {
658658

659659
function init() {
660660
disableActionButtons();
661-
var ws = getSocket("method=init");
661+
var root = document.getElementById("namespaceTemp").value;
662+
var ws = getSocket("method=init&root=" + encodeURIComponent(root));
662663
ws.onmessage = showOutput('initOutput');
663664
}
664665

0 commit comments

Comments
 (0)