Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix unquoting when line has multiple file names #1349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/git/GitCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down