feature: add a button in diff view to ignore all whitespace changes (--ignore-all-space)

This commit is contained in:
leo 2024-09-30 11:34:09 +08:00
parent c1f6da1b31
commit d2a005c532
No known key found for this signature in database
10 changed files with 44 additions and 17 deletions

View file

@ -12,7 +12,7 @@ namespace SourceGit.Commands
private const string PREFIX_LFS_DEL = "-version https://git-lfs.github.com/spec/";
private const string PREFIX_LFS_MODIFY = " version https://git-lfs.github.com/spec/";
public Diff(string repo, Models.DiffOption opt, int unified)
public Diff(string repo, Models.DiffOption opt, int unified, bool ignoreWhitespace)
{
_result.TextDiff = new Models.TextDiff()
{
@ -22,7 +22,11 @@ namespace SourceGit.Commands
WorkingDirectory = repo;
Context = repo;
Args = $"diff --ignore-cr-at-eol --unified={unified} {opt}";
if (ignoreWhitespace)
Args = $"diff --ignore-cr-at-eol --ignore-all-space --unified={unified} {opt}";
else
Args = $"diff --ignore-cr-at-eol --unified={unified} {opt}";
}
public Models.DiffResult Result()