Skip to content

Commit

Permalink
Fix errors omitted when in subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
paleite committed Apr 8, 2021
1 parent 6e2cec1 commit 9f470e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("getDiffForFile", () => {
const diffFromFile = getDiffForFile("./mockfile.js", true);

const expectedArguments =
'git diff --diff-filter=ACM --staged --unified=0 "1234567"';
'git diff --diff-filter=ACM --relative --staged --unified=0 "1234567"';
expect(
mockedChildProcess.execSync.mock.calls[
mockedChildProcess.execSync.mock.calls.length - 1
Expand Down
2 changes: 2 additions & 0 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const getDiffForFile = (filePath: string, staged = false): string => {
"git",
"diff",
"--diff-filter=ACM",
"--relative",
staged && "--staged",
"--unified=0",
JSON.stringify(process.env.ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD"),
Expand All @@ -47,6 +48,7 @@ const getDiffFileList = (staged = false): string[] => {
"diff",
"--diff-filter=ACM",
"--name-only",
"--relative",
staged && "--staged",
JSON.stringify(process.env.ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD"),
]
Expand Down

0 comments on commit 9f470e7

Please sign in to comment.