diff --git a/src/git/GitCli.ts b/src/git/GitCli.ts index 5ace99cd..1db7d277 100644 --- a/src/git/GitCli.ts +++ b/src/git/GitCli.ts @@ -658,9 +658,18 @@ export function status(type = null) { const statusArr = []; let file = line.substring(3); + let display = file; + const io = file.indexOf("->"); + if (io !== -1) { + file = file.substring(io + 2).trim(); + } + // check if the file is quoted if (_isquoted(file)) { file = _unquote(file); + if (io === -1) { + display = file; + } if (_isescaped(file)) { isEscaped = true; } @@ -712,12 +721,6 @@ export function status(type = null) { throw new Error("Unexpected status: " + statusChar); } - let display = file; - const io = file.indexOf("->"); - if (io !== -1) { - file = file.substring(io + 2).trim(); - } - // we don't want to display paths that lead to this file outside the project if (currentSubFolder && display.indexOf(currentSubFolder) === 0) { display = display.substring(currentSubFolder.length);