Repository navigation
fix: skip locked directories on checkout to match git behavior STUD-81465 - #34
Open
daniel-dumitrascu wants to merge 2 commits into
Open
daniel-dumitrascu wants to merge 2 commits into
daniel-dumitrascu wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Author
|
Companion Studio PR with the rebase abort cleanup: https://github.com/UiPath/Studio/pull/30537 |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
STUD-81465: Studio branch switch, pull and rebase fail with
could not rmdir 'Data/': Access is deniedwhen another process holds a working-tree folder open, while command-line git completes the same operation. Telemetry shows 912 unique users hitting this signature in 90 days.Git tracks files, not directories. After deleting the last tracked file in a directory, both git and libgit2 try to remove the now-empty directory as housekeeping. Git ignores a failure of that step (
unpack-trees.c/dir.cdiscard thermdirresult). libgit2 maps the Windows sharing violation toEBUSYand fails the whole checkout, after some files were already deleted, unlessGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIESis set. LibGit2Sharp never exposed that flag.What
GitCheckoutOptsWrapperalways addsGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIESto the checkout strategy. Every file change still happens; only the removal of an emptied directory is allowed to fail, and the directory is left behind empty, exactly like git. Covers checkout, rebase, reset, merge, stash and clone, since all build their options here.CheckoutSucceedsWhenAnEmptiedDirectoryIsHeldOpenByAnotherProcessholds a handle on the directory without delete sharing (the kind Explorer or a shell keeps on its current directory) and checks out a branch that deletes the only file in it. The test fails without the flag with the ticket's error and passes with it.CHANGES.mdentry.Verification
A new
LibGit2Sharp.UiPathpackage is needed for Studio to pick this up; the Studio-side changes (abort cleanup) are in a separate Studio PR and do not depend on it.🤖 Generated with Claude Code