Skip to content

Commit

Permalink
Merge pull request #985 from chromaui/todd/fix-dependency-tracing-win…
Browse files Browse the repository at this point in the history
…dows

Use double quotes around command arguments
  • Loading branch information
tevanoff committed May 15, 2024
2 parents d4b3fe2 + e7be52e commit 652f985
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node-src/git/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
2 changes: 1 addition & 1 deletion node-src/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 652f985

Please sign in to comment.