From b1407a87b05c2e9512eba9f44247dfd64c33cdfe Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 10 Oct 2017 18:04:14 +1100 Subject: [PATCH] disable lookup for GitHub's version of Git If the classic GitHub for Windows (creatively named github.exe) is installed alongside the new GitHub Desktop (which installs a github.bat file to PATH), we can get into the situation where Code can ask the GUI to authenticate for a private repository, which it doesn't understand. --- extensions/git/src/git.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index bc9ac5398a8..5edc8c6d258 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -118,26 +118,11 @@ function findSystemGitWin32(base: string): Promise { return findSpecificGit(path.join(base, 'Git', 'cmd', 'git.exe')); } -function findGitHubGitWin32(): Promise { - const github = path.join(process.env['LOCALAPPDATA'], 'GitHub'); - - return readdir(github).then(children => { - const git = children.filter(child => /^PortableGit/.test(child))[0]; - - if (!git) { - return Promise.reject('Not found'); - } - - return findSpecificGit(path.join(github, git, 'cmd', 'git.exe')); - }); -} - function findGitWin32(): Promise { return findSystemGitWin32(process.env['ProgramW6432']) .then(void 0, () => findSystemGitWin32(process.env['ProgramFiles(x86)'])) .then(void 0, () => findSystemGitWin32(process.env['ProgramFiles'])) - .then(void 0, () => findSpecificGit('git')) - .then(void 0, () => findGitHubGitWin32()); + .then(void 0, () => findSpecificGit('git')); } export function findGit(hint: string | undefined): Promise {