-
Notifications
You must be signed in to change notification settings - Fork 2.5k
checkout fails when checking out branches on an NTFS or Fat32 drive from MacOS or Linux #4504
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
Comments
I've built a sketchy (and somewhat wrong) checkout example (https://github.com/tiennou/libgit2/tree/examples/checkout) for the occasion, and can confirm it fails to checkout (from It seems we're using the build architecture to do some |
tiennou
added a commit
to tiennou/libgit2
that referenced
this issue
Jan 31, 2018
tiennou
added a commit
to tiennou/libgit2
that referenced
this issue
Feb 4, 2018
tiennou
added a commit
to tiennou/libgit2
that referenced
this issue
Feb 5, 2018
@tiennou Any progress on this? Thanks for looking into it! |
ethomson
added a commit
to ethomson/libgit2
that referenced
this issue
Feb 20, 2018
ethomson
added a commit
to ethomson/libgit2
that referenced
this issue
Feb 20, 2018
pks-t
pushed a commit
to pks-t/libgit2
that referenced
this issue
Feb 28, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Reproduction steps
Create a repo on an NTFS or Fat32 drive and try to checkout different branches from either MacOS or Linux.
Expected behavior
Checkout works fine
Actual behavior
Checkout fails due to potential filemode issues
Version of libgit2 (release number or SHA1)
Any version after this PR was merged
Operating system(s) tested
MacOSx
Ubuntu 16.04
This works fine on Windows since Windows does not care about filemode, but after said PR was merged there seem to be issues when the target drive does not care about filemodes on an OS that does.
I tracked it down finally and it turns out we get in a weird state where we have an added file in our current branch that is not in the branch I want to check out, and when the checkout code tries to remove this file it finds that the
mtime
andmode
on the workdir version of the file do not match that of the index. This causes the code to check themode
against thebaseitem->mode
which always fails. Since we are doing a safe checkout the checkout says there is a conflict that needs to be resolved and fails.Here is where it fails
Not sure what exactly causes the state or how to properly rectify it yet. Attached is a repo that can reproduce the issue. Just unzip it and checkout any of the other branches with libgit2. I tried to diagnose this myself but I ran out of time and haven't had another chance since I originally found the issue. Ed told me to open an issue here so maybe another contributor could have a crack at it if they have time.
dummyrepo.zip
The text was updated successfully, but these errors were encountered: