Skip to content

Commit 8f167a2

Browse files
committed
Fix renamed and modified files not handled.
1 parent 3d5e9cb commit 8f167a2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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
const diffFromFile = getDiffForFile("./mockfile.js", true);
5757

5858
const expectedArguments =
59-
'git diff --diff-algorithm=histogram --diff-filter=ACM --relative --staged --unified=0 "1234567"';
59+
'git diff --diff-algorithm=histogram --diff-filter=ACM -M100% --relative --staged --unified=0 "1234567"';
6060
expect(
6161
mockedChildProcess.execSync.mock.calls[
6262
mockedChildProcess.execSync.mock.calls.length - 1

src/git.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const getDiffForFile = (filePath: string, staged = false): string => {
2525
"diff",
2626
"--diff-algorithm=histogram",
2727
"--diff-filter=ACM",
28+
"-M100%",
2829
"--relative",
2930
staged && "--staged",
3031
"--unified=0",
@@ -51,6 +52,7 @@ const getDiffFileList = (): string[] => {
5152
"diff",
5253
"--diff-algorithm=histogram",
5354
"--diff-filter=ACM",
55+
"-M100%",
5456
"--name-only",
5557
"--relative",
5658
"--staged",

0 commit comments

Comments
 (0)