(result: IGitResult)
| 428 | * output. |
| 429 | */ |
| 430 | export function parseConfigLockFilePathFromError(result: IGitResult) { |
| 431 | const match = lockFilePathRe.exec(coerceToString(result.stderr)) |
| 432 | |
| 433 | if (match === null) { |
| 434 | return null |
| 435 | } |
| 436 | |
| 437 | // Git on Windows may print the config file path using forward slashes. |
| 438 | // Luckily for us forward slashes are not allowed in Windows file or |
| 439 | // directory names so we can simply replace any instance of forward |
| 440 | // slashes with backslashes. |
| 441 | const normalized = __WIN32__ ? match[1].replace('/', '\\') : match[1] |
| 442 | |
| 443 | // https://github.com/git/git/blob/232378479/lockfile.h#L117-L119 |
| 444 | return Path.resolve(result.path, `${normalized}.lock`) |
| 445 | } |
| 446 | |
| 447 | export function getDescriptionForError( |
| 448 | error: DugiteError, |
no test coverage detected