Skip to content

Commit d03599a

Browse files
committed
Prefer --find-renames over -M
1 parent 7727a9b commit d03599a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/__fixtures__/postprocessArguments.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { Linter } from "eslint";
22

3-
const postprocessArguments: [Linter.LintMessage[][], string] = [
3+
const postprocessArguments: [
4+
[[Linter.LintMessage, ...Linter.LintMessage[]], ...Linter.LintMessage[][]],
5+
string
6+
] = [
47
[
58
[
69
{

src/git.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe("getDiffForFile", () => {
5656

5757
const expectedCommand = "git";
5858
const expectedArgs =
59-
'diff --no-ext-diff --diff-algorithm=histogram --diff-filter=ACM -M100% --relative --staged --unified=0 1234567';
59+
"diff --diff-algorithm=histogram --diff-filter=ACM --find-renames=100% --no-ext-diff --relative --staged --unified=0 1234567";
6060

6161
const lastCall = mockedChildProcess.execFileSync.mock.calls.at(-1);
6262
const [command, argsIncludingFile = []] = lastCall ?? [""];

src/git.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ const COMMAND = "git";
77
const getDiffForFile = (filePath: string, staged = false): string => {
88
const args = [
99
"diff",
10-
"--no-ext-diff",
1110
"--diff-algorithm=histogram",
1211
"--diff-filter=ACM",
13-
"-M100%",
12+
"--find-renames=100%",
13+
"--no-ext-diff",
1414
"--relative",
1515
staged && "--staged",
1616
"--unified=0",
@@ -28,11 +28,11 @@ const getDiffForFile = (filePath: string, staged = false): string => {
2828
const getDiffFileList = (): string[] => {
2929
const args = [
3030
"diff",
31-
"--no-ext-diff",
3231
"--diff-algorithm=histogram",
3332
"--diff-filter=ACM",
34-
"-M100%",
33+
"--find-renames=100%",
3534
"--name-only",
35+
"--no-ext-diff",
3636
"--relative",
3737
"--staged",
3838
process.env.ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD",

0 commit comments

Comments
 (0)