Strange case of badFilemode #1519
-
In recent versions of Git, running I don't know if this is a known limitation, absent feature, or bug in The repository has submodules but whether they are cloned or not doesn't have an affect on this behavior. This is also not a result of how the repository is cloned in terms of
The above is in Ubuntu 24.04 LTS but I also verified this on Windows 10. This does not seem to vary by operating system, except that some operating systems that provide In I had expected the modes to be checked on retrieval, but that doesn't seem to happen. For And for So that information is lost, and that any unidentified mode is treated as a submodule ( But it feels like In a way this might be two questions in one. If there is nothing to be done in gitoxide because file mode validation is outside the scope of the current |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for bringing this up! First of all, I checked what
In conclusion, I think this is a bug in Git - it should not discards mode-bits when printing for the purpose truly showing a tree - right now it doesn't look like that exists. The |
Beta Was this translation helpful? Give feedback.
Thanks for bringing this up!
First of all, I checked what
git fsck
is doing and it looks like it finds a tree that prints its entries correctly, but probably has some extra bits set in the part that isn't printing (see source). Thus it looks OK, but probably isn't. This could be validated by printing with an altered version of Git that doesn't truncate the mode.gix-fsck
is just a demo at this point, as it misses way too much and indeed, should have a proper mode-check instead of relying on the discretized enum. There might even be hidden bugs if code keeps insisting that all modes are correct, or falls back to thinking it's a submodule. Maybe the latter is the least destructive, but mayb…