I stumbled into learning that Windows (or NTFS?) does not allow filenames with trailing dots.
Internally it appearsthe dot is a separator between the base filename and the extension. Some tools treat the final dot as implied, so type plain.
will show the contents of a file named plain
.
Armed with this curiosity I decided to create a troublesome git repository to discover how Windows would treat such a thing?
- Indiscriminate error?
- Pick one arbitrary conflicting name?
- Privilege escalation?
https://github.com/PeterShinners/doomdots
PS C:\dev> git clone https://github.com/PeterShinners/doomdots.git
Cloning into 'doomdots'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 35 (delta 10), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (35/35), 10.41 KiB | 1.16 MiB/s, done.
Resolving deltas: 100% (10/10), done.
error: invalid path 'MIXed.'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
PS C:\dev> cd .\doomdots\
PS C:\dev> git switch main
error: invalid path 'MIXed.'
error: invalid path 'enddot.'
error: invalid path 'extdot.txt.'
It's likely these errors come from Git itself, and there's an alternative where it could fallback on some undefined system behavior.
Anyways, one more corner case to avoid along with mixed case naming conflicts and invalid characters.
Top comments (0)