[PATCH 0/6] fast-import: tighten parsing of paths
- From
Thalia Archibald <thalia@archibald.dev>
- Date
- Mar 22, 2024, 00:03 UTC
- Message-ID
- <20240322000304.76810-1-thalia@archibald.dev>
fast-import has subtle differences in how it parses file paths between each occurrence of <path> in the grammar. Many errors are suppressed or not checked, which could lead to silent data corruption. A particularly bad case is when a front-end sent escapes that Git doesn't recognize (e.g., hex escapes are not supported), it would be treated as literal bytes instead of a quoted string.
Bring path parsing into line with the documented behavior and improve documentation to fill in missing details.
This patch series is patterned after 06454cb9a3 (fast-import: tighten parsing of datarefs, 2012-04-07), which did similar fixes across the grammar, but for marks.
This is my first contribution to Git, so please let me know if there's something I've missed. I'm working on a tool for advanced repo transformations (like a union of filter-repo and Reposurgeon workflows), so I've been living in fast-import code and I have more parsing fixes planned.
Thalia