Skip to content

Windows "could not rmdir" leaves corrupt workspace state #11553

@BC-MOR

Description

@BC-MOR

Version

0.18.3

Operating System

Windows

Distribution Method

winget (Windows)

Describe the issue

As described in #3560 when unapplying a stack which contains any directories which are open in e.g. VS Code gitbutler encounters the following error

command: unapply_stack
params: {"projectId":"17c57266-f021-47b3-89af-1dd3b8206376","stackId":"c63a3115-c88f-4e34-9238-7b7e31a5aa7d"})

could not rmdir 'G:/projects/<myProject>/': The process cannot access the file because it is being used by another process.
; class=Os (2)

This is a general problem but not the reason for the issue. GitButler also partially unapplies the stack and leaves the user in a broken state

Image

To fix this the user has to go to the oplog and revert the last operation.

How to reproduce (Optional)

No response

Expected behavior (Optional)

I would propose that whenever GitButler encounters an error it reverts the last operation automatically so that there is no broken state. Alternatively a 'revert last operation' button in the error pop-up would also make this easier.

Relevant log output (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingos:windowsThe Windows platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions