Skip to content

Detects a clean repository as dirty (Windows, symlinks) #882

@nathanhammond

Description

@nathanhammond

cargo release, when run on Windows, for a repository containing symlinks, gets incorrect results about the status of files.

Reduced reproduction: https://github.com/xnorpx/symlink_publish
Environment: Windows
core.symlinks set to true

Test:

git clone https://github.com/xnorpx/symlink_publish
cd symlink_publish
cargo release

Failure:

>cargo release
error: uncommitted changes detected, please resolve before release:
  copy/original (Status(WT_MODIFIED))
  Publishing symlink_publish
    Updating crates.io index
   Packaging symlink_publish v0.1.0 (C:\git\symlink_publish)
    Packaged 9 files, 2.6KiB (1.8KiB compressed)
   Verifying symlink_publish v0.1.0 (C:\git\symlink_publish)
   Compiling symlink_publish v0.1.0 (C:\git\symlink_publish\target\package\symlink_publish-0.1.0)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.77s
   Uploading symlink_publish v0.1.0 (C:\git\symlink_publish)
warning: aborting upload due to dry run
     Pushing Pushing main, v0.1.0 to origin
error: dry-run failed, resolve the above errors and try again.

Notably, git status in the repository returns "clean" as expected.

The status enum value comes from libgit2 via git2, so it's very plausibly an upstream issue. I did not see any issues filed upstream in a cursory search.

/cc @xnorpx, my colleague who encountered the issue, and reduced it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions