Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: github/VFSForGit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ac974c7
Choose a base ref
...
head repository: github/VFSForGit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a50f57a
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on May 15, 2019

  1. improve Linux placeholder deletion error handling

    By using native rmdir(2) syscalls when deleting placeholder
    directories, we can specifically detect the non-empty directory
    error condition ENOTEMPTY, which is otherwise folded into a
    generic IOException by Directory.Delete().
    
    We need to return EDirectoryNotEmpty in this case because the
    calling code in GitIndexProjection handles this result as an
    expected and non-exceptional condition.
    
    To simplify our code we then also use unlink(2) to delete files
    in a common NativeMethods subclass.
    
    We further detect the case where an inode is neither a file
    nor a directory (libprojfs's API will return EPERM for such inodes)
    by introducing an Unknown projection state and reporting this as
    a "full file" condition to our caller, in the same manner as the
    macOS PrjFSLib C++ implementation.
    
    Finally, we handle requests to delete the repository's root
    directory by returning EDirectoryNotEmpty, instead of ignoring
    them and returning Success.  This is necessary to avoid short-
    circuiting the logic of the calling UpdatePlaceholders() method
    in GitIndexProjection, which otherwise would fail to correctly
    populate a new view of the repository if we return Success when
    asked to delete the repository's root.  Since the repository's
    root directory is expected to always contain, at a minimum, the
    .git subdirectory, EDirectoryNotEmpty is appropriate.
    chrisd8088 committed May 15, 2019
    Configuration menu
    Copy the full SHA
    18a1486 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2019

  1. use managed methods and HResult for Linux updates

    We can return to using managed methods to delete files and
    directories when updating projection views on Linux, so long as
    we check the IOException's HResult property to detect the
    EDirectoryNotEmpty (ENOTEMPTY) condition.
    
    Also set the (unused?) failure cause of ReadOnly when an
    access exception occurs.
    
    Thanks to @kivikakk for the hint on checking HResult!
    chrisd8088 committed May 17, 2019
    Configuration menu
    Copy the full SHA
    76dea7d View commit details
    Browse the repository at this point in the history
  2. align Linux projection update exception blocks

    Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
    chrisd8088 and kivikakk committed May 17, 2019
    Configuration menu
    Copy the full SHA
    a50f57a View commit details
    Browse the repository at this point in the history
Loading