use config.configDir as cwd
This commit is contained in:
parent
6e2f581a3c
commit
7716b23c14
|
|
@ -234,7 +234,7 @@ function createLoadTask(mode: 'out-of-process' | 'in-process', options: { filter
|
|||
if (testRun.config.cliOnlyChanged && options.filterOnlyChanged) {
|
||||
for (const plugin of testRun.config.plugins)
|
||||
await plugin.instance?.populateDependencies?.();
|
||||
const changedFiles = await detectChangedFiles(testRun.config.cliOnlyChanged);
|
||||
const changedFiles = await detectChangedFiles(testRun.config.cliOnlyChanged, testRun.config.configDir);
|
||||
cliOnlyChangedMatcher = file => changedFiles.has(file);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ import childProcess from 'child_process';
|
|||
import { affectedTestFiles } from '../transform/compilationCache';
|
||||
import path from 'path';
|
||||
|
||||
export async function detectChangedFiles(baseCommit: string): Promise<Set<string>> {
|
||||
export async function detectChangedFiles(baseCommit: string, configDir: string): Promise<Set<string>> {
|
||||
function gitFileList(command: string) {
|
||||
try {
|
||||
return childProcess.execSync(
|
||||
`git ${command}`,
|
||||
{ encoding: 'utf-8', stdio: 'pipe' }
|
||||
{ encoding: 'utf-8', stdio: 'pipe', cwd: configDir }
|
||||
).split('\n').filter(Boolean);
|
||||
} catch (_error) {
|
||||
const error = _error as childProcess.SpawnSyncReturns<string>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue