When Git Filenames Break Windows Checkouts — How to Catch Them in CI?
Описание и применение
Проверка файловых имен в репозитории Git на совместимость с Windows с помощью RepoPort и GitHub Actions, чтобы предотвратить ошибки при checkout.
Задача
Git repositories can checkout successfully on Linux but fail on Windows due to filenames that the Windows filesystem cannot handle, such as case‑conflicting names or reserved device names.
Результат
The CI workflow detects and blocks commits containing filenames that would break on Windows, ensuring cross‑platform compatibility before code integration.
Рабочий процесс
- Create a disposable repo on Linux and add the problematic files to the Git index.
- Run RepoPort locally with
python -m repoport check .to detect case collisions and Windows‑reserved names. - Rename the conflicting files using
git mvto unique names and commit the changes. - Add a GitHub Actions workflow that checks the Git index with RepoPort on every push and pull request.
- Configure the workflow to fail if RepoPort exits with code 1, preventing merges with problematic filenames.
Доказательства
Git can track all three paths. Whether another system can check them out is a different question.
[case-collision] 'assets/Logo.svg', 'assets/logo.svg': These paths collide after NFC normalization and Unicode case folding; choose names that remain distinct without case sensitivity.
[windows-reserved-name] 'docs/NUL.txt': Windows reserves this device name, including with extensions; rename this file or directory.
The workflow checks the index populated by actions/checkout for the revision under test.
- Дата записи: 2026-10-26T08:11:26.404Z