Skip to content

gc: Verify du_git_checkout works on Windows #13064

Open
@ehuss

Description

@ehuss

The function du_git_checkout needs some investigation on how it works with Windows.

The way git checkouts work on Unix is that git2 creates a clone from the "db" to the "checkout". The clone uses hard-links into the .git directory so that it doesn't use any additional disk space. However, I'm not sure how this works on Windows. Does it copy the files? Does it use junctions or other styles of links?

If Windows doesn't use some kind of link or COW, then the code in du_git_checkout is not correct because it is not counting the .git directory contents under the assumption that clones are links.

If this is a problem, then there are a few different options:

  • Use a smarter du which knows about hard-links.
  • Use git worktrees instead of clones.
  • Make the !.git pattern depend on the platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gitArea: anything dealing with gitO-windowsOS: WindowsP-lowPriority: LowS-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.Z-gcNightly: garbage collection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions