diff --git a/node-src/git/git.test.ts b/node-src/git/git.test.ts index 821522dd1..c21b4bf31 100644 --- a/node-src/git/git.test.ts +++ b/node-src/git/git.test.ts @@ -136,7 +136,7 @@ describe('findFilesFromRepositoryRoot', () => { const results = await findFilesFromRepositoryRoot('package.json', '**/package.json'); expect(command).toBeCalledTimes(2); - expect(command).toHaveBeenNthCalledWith(2, "git ls-files --full-name -z '/root/package.json' '/root/**/package.json'", expect.any(Object)); + expect(command).toHaveBeenNthCalledWith(2, 'git ls-files --full-name -z "/root/package.json" "/root/**/package.json"', expect.any(Object)); expect(results).toEqual(filesFound); }); }); diff --git a/node-src/git/git.ts b/node-src/git/git.ts index e30b35eab..1b05f9585 100644 --- a/node-src/git/git.ts +++ b/node-src/git/git.ts @@ -295,7 +295,7 @@ export async function findFilesFromRepositoryRoot(...patterns: string[]) { // Uses `--full-name` to ensure that all files found are relative to the repository root, // not the directory in which this is executed from - const gitCommand = `git ls-files --full-name -z ${patternsFromRoot.map((p) => `'${p}'`).join(' ')}`; + const gitCommand = `git ls-files --full-name -z ${patternsFromRoot.map((p) => `"${p}"`).join(' ')}`; const files = await execGitCommand(gitCommand); return files.split(NULL_BYTE).filter(Boolean); }