* If `s` starts with a double quote, unquotes it using C-style escape * rules (as used by Git). Otherwise returns `s` as-is.
(s: string)
| 338 | * rules (as used by Git). Otherwise returns `s` as-is. |
| 339 | */ |
| 340 | function unquoteIfQuoted(s: string): string { |
| 341 | if (s.startsWith('"')) { |
| 342 | const parsed = parseQuotedFileName(s); |
| 343 | if (parsed) { |
| 344 | return parsed.fileName; |
| 345 | } |
| 346 | } |
| 347 | return s; |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Parses a C-style quoted filename as used by Git or GNU `diff -u`. |
no test coverage detected