Skip to content

Commit 244d130

Browse files
authored
Merge pull request #424 from intersystems/fix-423-filename-spaces
Fixed workspace list and diff of files with spaces in names
2 parents 142e998 + c9423cb commit 244d130

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
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 JS errors in Studio on certain operations (#416)
12+
- WebUI workspace view now works properly for filenames with spaces (#423)
1213
- Fixed error popups in interop editors in Studio on 2024.1 (#417)
1314

1415
## [2.4.0] - 2024-07-08

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,11 +1304,11 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
13041304
right.webuiPrevScrollTop = 0;
13051305
right.webuiPrevScrollLeft = 0;
13061306
}
1307-
webui.git("ls-files "+file, function(path){
1308-
self.gitFile = file;
1307+
webui.git("ls-files \""+file+"\"", function(path){
1308+
self.gitFile = "\"" + file + "\"";
13091309
self.noIndex = ""
13101310
if(path.length == 0 && file != undefined){
1311-
self.gitFile = " /dev/null " + file;
1311+
self.gitFile = " /dev/null " + "\"" + file + "\"";
13121312
self.noIndex = " --no-index "
13131313
}
13141314
if (self.gitCmd) {
@@ -2224,6 +2224,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22242224
} else {
22252225
model = line;
22262226
}
2227+
model = model.replace(/^"(.*)"$/g,'$1');
22272228

22282229
++self.filesCount;
22292230
var isForCurrentUser;

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,11 +1304,11 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
13041304
right.webuiPrevScrollTop = 0;
13051305
right.webuiPrevScrollLeft = 0;
13061306
}
1307-
webui.git("ls-files "+file, function(path){
1308-
self.gitFile = file;
1307+
webui.git("ls-files \""+file+"\"", function(path){
1308+
self.gitFile = "\"" + file + "\"";
13091309
self.noIndex = ""
13101310
if(path.length == 0 && file != undefined){
1311-
self.gitFile = " /dev/null " + file;
1311+
self.gitFile = " /dev/null " + "\"" + file + "\"";
13121312
self.noIndex = " --no-index "
13131313
}
13141314
if (self.gitCmd) {
@@ -2224,6 +2224,7 @@ webui.NewChangedFilesView = function(workspaceView) {
22242224
} else {
22252225
model = line;
22262226
}
2227+
model = model.replace(/^"(.*)"$/g,'$1');
22272228

22282229
++self.filesCount;
22292230
var isForCurrentUser;

0 commit comments

Comments
 (0)