Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

may reuse a dirty worktree from previous PR errors #142

Open
ehuss opened this issue May 15, 2021 · 1 comment
Open

may reuse a dirty worktree from previous PR errors #142

ehuss opened this issue May 15, 2021 · 1 comment

Comments

@ehuss
Copy link

ehuss commented May 15, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ehuss and others