@@ -10,28 +10,9 @@ export interface GitResult {
1010
1111const DEFAULT_TIMEOUT = 5000 ;
1212
13- // Extra dirs to search for git-crypt (extension host PATH is often minimal)
14- const EXTRA_PATH_DIRS = [
15- '/opt/homebrew/bin' ,
16- '/usr/local/bin' ,
17- '/usr/bin' ,
18- ] ;
19-
20- // Augmented PATH for all child processes
21- let augmentedPath : string | undefined ;
22-
23- function getEnv ( ) : NodeJS . ProcessEnv {
24- if ( ! augmentedPath ) {
25- const existing = process . env . PATH ?? '' ;
26- const dirs = EXTRA_PATH_DIRS . filter ( d => ! existing . split ( ':' ) . includes ( d ) ) ;
27- augmentedPath = dirs . length ? `${ existing } :${ dirs . join ( ':' ) } ` : existing ;
28- }
29- return { ...process . env , PATH : augmentedPath } ;
30- }
31-
3213export function gitExec ( cwd : string , args : string [ ] , timeout = DEFAULT_TIMEOUT ) : Promise < GitResult > {
3314 return new Promise ( resolve => {
34- execFile ( 'git' , args , { cwd, timeout, maxBuffer : 10 * 1024 * 1024 , env : getEnv ( ) } , ( error , stdout , stderr ) => {
15+ execFile ( 'git' , args , { cwd, timeout, maxBuffer : 10 * 1024 * 1024 } , ( error , stdout , stderr ) => {
3516 resolve ( {
3617 stdout : stdout ?? '' ,
3718 stderr : stderr ?? '' ,
@@ -43,7 +24,7 @@ export function gitExec(cwd: string, args: string[], timeout = DEFAULT_TIMEOUT):
4324
4425export async function isGitCryptAvailable ( ) : Promise < boolean > {
4526 return new Promise ( resolve => {
46- execFile ( 'git-crypt' , [ '--version' ] , { timeout : 3000 , env : getEnv ( ) } , error => {
27+ execFile ( 'git-crypt' , [ '--version' ] , { timeout : 3000 } , error => {
4728 resolve ( ! error ) ;
4829 } ) ;
4930 } ) ;
@@ -71,7 +52,7 @@ export async function getGitCryptFiles(repoRoot: string): Promise<Set<string>> {
7152 const proc = execFile (
7253 'git' ,
7354 [ 'check-attr' , 'filter' , '--stdin' ] ,
74- { cwd : repoRoot , timeout : DEFAULT_TIMEOUT , maxBuffer : 10 * 1024 * 1024 , env : getEnv ( ) } ,
55+ { cwd : repoRoot , timeout : DEFAULT_TIMEOUT , maxBuffer : 10 * 1024 * 1024 } ,
7556 ( error , stdout , stderr ) => {
7657 resolve ( {
7758 stdout : stdout ?? '' ,
0 commit comments