From afd6bde642a64f8a8e98a0228bc5e0665162b858 Mon Sep 17 00:00:00 2001 From: Erik Koopmans Date: Tue, 24 Apr 2018 00:04:09 +1000 Subject: [PATCH] Fix unquoting when line has multiple file names --- src/git/GitCli.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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);