Skip to content

Commit 4a35674

Browse files
love-lingerbiancode
authored andcommitted
enhance: set core.autocrlf to false when run git diff to get detail changes of selected file (sourcegit-scm#761)
1 parent 4302db7 commit 4a35674

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Commands/Diff.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public Diff(string repo, Models.DiffOption opt, int unified, bool ignoreWhitespa
3030
Context = repo;
3131

3232
if (ignoreWhitespace)
33-
Args = $"diff --no-ext-diff --patch --ignore-all-space --unified={unified} {opt}";
33+
Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --ignore-all-space --unified={unified} {opt}";
3434
else if (Models.DiffOption.IgnoreCRAtEOL)
35-
Args = $"diff --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}";
35+
Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}";
3636
else
37-
Args = $"diff --no-ext-diff --patch --unified={unified} {opt}";
37+
Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --unified={unified} {opt}";
3838
}
3939

4040
public async Task<Models.DiffResult> ReadAsync()

0 commit comments

Comments
 (0)