fix(core): Wrap head + base arguments in quotes in execSyn (#5240)
On windows caret symbols are removed from command line args unless wrapped in double quotes, causing an error in this case. Closes #4828.
This commit is contained in:
parent
9180e9094c
commit
4b61d44615
@ -45,19 +45,21 @@ function getUntrackedFiles(): string[] {
|
||||
function getFilesUsingBaseAndHead(base: string, head: string): string[] {
|
||||
let mergeBase;
|
||||
try {
|
||||
mergeBase = execSync(`git merge-base ${base} ${head}`, {
|
||||
mergeBase = execSync(`git merge-base "${base}" "${head}"`, {
|
||||
maxBuffer: TEN_MEGABYTES,
|
||||
})
|
||||
.toString()
|
||||
.trim();
|
||||
} catch {
|
||||
mergeBase = execSync(`git merge-base --fork-point ${base} ${head}`, {
|
||||
mergeBase = execSync(`git merge-base --fork-point "${base}" "${head}"`, {
|
||||
maxBuffer: TEN_MEGABYTES,
|
||||
})
|
||||
.toString()
|
||||
.trim();
|
||||
}
|
||||
return parseGitOutput(`git diff --name-only --relative ${mergeBase} ${head}`);
|
||||
return parseGitOutput(
|
||||
`git diff --name-only --relative "${mergeBase}" "${head}"`
|
||||
);
|
||||
}
|
||||
|
||||
function parseGitOutput(command: string): string[] {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user