From 604bf40b03a3afd38917d6a1f0d43386f86a9fd6 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 31 Jan 2021 01:36:02 -0500 Subject: [PATCH] Fixes #1354 - quotes terminal args if needed --- CHANGELOG.md | 1 + src/git/models/repository.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 021d779..54221fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed +- Fixes [#1354](https://github.com/eamodio/vscode-gitlens/issues/1354) - Stuck after merge a branch with a single quote in the name - Fixes [#863](https://github.com/eamodio/vscode-gitlens/issues/863) - Pulling all repositories doesn't work unless built-in Git knows about the repo (requires VS Code v1.53 or later) - Fixes [#1332](https://github.com/eamodio/vscode-gitlens/issues/1332) - Stashes created with command line don't show up in the "Stashes" section - Fixes [#1045](https://github.com/eamodio/vscode-gitlens/issues/1045) - View File History not working - absolute path used — thanks to [PR #1334](https://github.com/eamodio/vscode-gitlens/pull/1334) by egfx-notifications ([@egfx-notifications](https://github.com/egfx-notifications)) diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index 9d578ff..064ee18 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -1084,7 +1084,7 @@ export class Repository implements Disposable { } private runTerminalCommand(command: string, ...args: string[]) { - const parsedArgs = args.map(arg => (arg.startsWith('#') ? `"${arg}"` : arg)); + const parsedArgs = args.map(arg => (arg.startsWith('#') || arg.includes("'") ? `"${arg}"` : arg)); runGitCommandInTerminal(command, parsedArgs.join(' '), this.path, true); setTimeout(() => this.fireChange(RepositoryChange.Unknown), 2500);