Skip to content

may reuse a dirty worktree from previous PR errors #142

Open
@ehuss

Description

@ehuss

In rust-lang/rust#82208 there was an issue where the git merge bors used ran into an internal git error:

error: add_cacheinfo failed to refresh for path 'src/tools/rustfmt/tests/target/issue-3494/crlf.rs'; merge aborting.
s

This was due to some odd crlf git attribute issues.

The consequence is that it left the git worktree in a state where there are modified files, but git doesn't think that the merge failed. I believe the calls here are normally responsible for cleaning up the directory due to any merge failures. However, in this case, git doesn't know there was a merge failure, and thus leaves the worktree with modified files. When the next PR comes along that happens to touch any of the same files, it will result in an error:

error: Your local changes to the following files would be overwritten by checkout:
    2021-05-14T20:46:41.710-04:00   src/bootstrap/builder.rs
    2021-05-14T20:46:41.710-04:00   src/bootstrap/check.rs
    2021-05-14T20:46:41.710-04:00   src/bootstrap/test.rs
    2021-05-14T20:46:41.710-04:00   Please commit your changes or stash them before you switch branches.

Ideally, I think homu should be a little more careful about making sure that the worktree is clean. Perhaps something like reset --hard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions