Skip to content

Commit bb2fbee

Browse files
authored
Fix edge case where stash confirmation did not work as expected when all changes were made by a different user (#195)
Co-authored-by: Sarmishta Velury <isc-svelury@users.noreply.github.com>
1 parent 80c37c7 commit bb2fbee

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,9 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
22382238
}
22392239
removeUnavailableModal(popup);
22402240
if(action == 'discard'){
2241-
self.cancel()
2241+
self.cancel();
2242+
} else if(action == 'stash'){
2243+
self.stash();
22422244
}
22432245
else{
22442246
self.process();
@@ -2345,18 +2347,17 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
23452347

23462348
if(combinedFiles.length>0)
23472349
confirmActionForUnavailableFile(combinedFiles, action);
2348-
workspaceView.update("stash");
2349-
23502350
}
23512351

23522352
self.stash = function() {
23532353
var files = self.getFileList(undefined, "D", 0, 1);
23542354
var rmFiles = self.getFileList("D", undefined, 0, 1);
2355-
var combinedFiles = files+" "+rmFiles;
2355+
var combinedFiles = files.concat(rmFiles);
23562356

23572357
if(combinedFiles.length != 0){
23582358
webui.git("stash push -- " + combinedFiles, function(output){
23592359
webui.showSuccess(output);
2360+
workspaceView.update("stash");
23602361
});
23612362
}
23622363
}

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,9 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
22382238
}
22392239
removeUnavailableModal(popup);
22402240
if(action == 'discard'){
2241-
self.cancel()
2241+
self.cancel();
2242+
} else if(action == 'stash'){
2243+
self.stash();
22422244
}
22432245
else{
22442246
self.process();
@@ -2345,18 +2347,17 @@ webui.ChangedFilesView = function(workspaceView, type, label) {
23452347

23462348
if(combinedFiles.length>0)
23472349
confirmActionForUnavailableFile(combinedFiles, action);
2348-
workspaceView.update("stash");
2349-
23502350
}
23512351

23522352
self.stash = function() {
23532353
var files = self.getFileList(undefined, "D", 0, 1);
23542354
var rmFiles = self.getFileList("D", undefined, 0, 1);
2355-
var combinedFiles = files+" "+rmFiles;
2355+
var combinedFiles = files.concat(rmFiles);
23562356

23572357
if(combinedFiles.length != 0){
23582358
webui.git("stash push -- " + combinedFiles, function(output){
23592359
webui.showSuccess(output);
2360+
workspaceView.update("stash");
23602361
});
23612362
}
23622363
}

0 commit comments

Comments
 (0)