Skip to content

Commit 8eeb0aa

Browse files
committed
Fixes #168 - missing process env
1 parent a014b8f commit 8eeb0aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/git/git.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async function gitCommandCore(options: GitCommandOptions, ...args: any[]): Promi
6767
const opts = { encoding: 'utf8', ...options };
6868
const s = await spawnPromise(git.path, args, {
6969
cwd: options.cwd,
70-
env: options.env,
70+
env: options.env || process.env,
7171
encoding: (opts.encoding === 'utf8') ? 'utf8' : 'binary'
7272
} as SpawnOptions);
7373

@@ -439,13 +439,13 @@ export class Git {
439439

440440
static status(repoPath: string, porcelainVersion: number = 1): Promise<string> {
441441
const porcelain = porcelainVersion >= 2 ? `--porcelain=v${porcelainVersion}` : '--porcelain';
442-
return gitCommand({ cwd: repoPath, env: { GIT_OPTIONAL_LOCKS: '0' } }, 'status', porcelain, '--branch', '-u');
442+
return gitCommand({ cwd: repoPath, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } }, 'status', porcelain, '--branch', '-u');
443443
}
444444

445445
static status_file(repoPath: string, fileName: string, porcelainVersion: number = 1): Promise<string> {
446446
const [file, root] = Git.splitPath(fileName, repoPath);
447447

448448
const porcelain = porcelainVersion >= 2 ? `--porcelain=v${porcelainVersion}` : '--porcelain';
449-
return gitCommand({ cwd: root, env: { GIT_OPTIONAL_LOCKS: '0' } }, 'status', porcelain, file);
449+
return gitCommand({ cwd: root, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } }, 'status', porcelain, file);
450450
}
451451
}

0 commit comments

Comments
 (0)