This is an automated email from the ASF dual-hosted git repository.

tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new cac3970b9df kie-issues#407: KIE Sandbox Accelerators break the current 
workspace if they fail to initialize (#2309)
cac3970b9df is described below

commit cac3970b9df751e6a95a89b340fd38618f70a7a3
Author: Luiz João Motta <[email protected]>
AuthorDate: Mon May 13 09:15:16 2024 -0300

    kie-issues#407: KIE Sandbox Accelerators break the current workspace if 
they fail to initialize (#2309)
---
 packages/online-editor/src/accelerators/AcceleratorsHooks.tsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/packages/online-editor/src/accelerators/AcceleratorsHooks.tsx 
b/packages/online-editor/src/accelerators/AcceleratorsHooks.tsx
index 534a2749c96..8998ed4d89d 100644
--- a/packages/online-editor/src/accelerators/AcceleratorsHooks.tsx
+++ b/packages/online-editor/src/accelerators/AcceleratorsHooks.tsx
@@ -159,11 +159,16 @@ export function useAcceleratorsDispatch(workspace: 
ActiveWorkspace) {
         }
 
         const workspaceFiles = await workspaces.getFiles({ workspaceId });
-
-        // Create new temporary branch with current files, but stay on current 
branch
+        // Create a backup branch with the current files, but stay on main
         await workspaces.branch({ workspaceId, name: BACKUP_BRANCH_NAME, 
checkout: false });
 
-        // Commit files to backup branch (this commit will never be pushed, as 
this branch will be deleted)
+        // Adds all files to the staging area
+        await workspaces.stageFile({
+          workspaceId,
+          relativePath: ".",
+        });
+
+        // Commit staged changes to the backup branch
         await workspaces.commit({
           workspaceId,
           commitMessage: `${env.KIE_SANDBOX_APP_NAME}: Backup files before 
applying ${accelerator.name} Accelerator`,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to