mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-22 05:40:43 +08:00
enhance: always turn off --color=<when> and --ext-diff when calling git diff in SourceGit (#1922)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -26,11 +26,11 @@ namespace SourceGit.Commands
|
||||
Context = repo;
|
||||
|
||||
if (ignoreWhitespace)
|
||||
Args = $"diff --no-ext-diff --patch --ignore-all-space --unified={unified} {opt}";
|
||||
Args = $"diff --no-color --no-ext-diff --patch --ignore-all-space --unified={unified} {opt}";
|
||||
else if (Models.DiffOption.IgnoreCRAtEOL)
|
||||
Args = $"diff --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}";
|
||||
Args = $"diff --no-color --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}";
|
||||
else
|
||||
Args = $"diff --no-ext-diff --patch --unified={unified} {opt}";
|
||||
Args = $"diff --no-color --no-ext-diff --patch --unified={unified} {opt}";
|
||||
}
|
||||
|
||||
public async Task<Models.DiffResult> ReadAsync()
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace SourceGit.Commands
|
||||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"diff --diff-algorithm=minimal {opt}";
|
||||
Args = $"diff --no-color --no-ext-diff --diff-algorithm=minimal {opt}";
|
||||
}
|
||||
|
||||
public async Task<Result> ReadAsync()
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace SourceGit.Commands
|
||||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"diff {Models.Commit.EmptyTreeSHA1} {commit} --numstat -- {path.Quoted()}";
|
||||
Args = $"diff --no-color --no-ext-diff --numstat {Models.Commit.EmptyTreeSHA1} {commit} -- {path.Quoted()}";
|
||||
RaiseError = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace SourceGit.Commands
|
||||
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"diff -a --ignore-cr-at-eol --check {opt}";
|
||||
Args = $"diff --no-color --no-ext-diff -a --ignore-cr-at-eol --check {opt}";
|
||||
}
|
||||
|
||||
public bool GetResult()
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace SourceGit.Commands
|
||||
var starter = new ProcessStartInfo();
|
||||
starter.WorkingDirectory = repo;
|
||||
starter.FileName = Native.OS.GitExecutable;
|
||||
starter.Arguments = $"diff --ignore-cr-at-eol --unified=4 {opt}";
|
||||
starter.Arguments = $"diff --no-color --no-ext-diff --ignore-cr-at-eol --unified=4 {opt}";
|
||||
starter.UseShellExecute = false;
|
||||
starter.CreateNoWindow = true;
|
||||
starter.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
|
||||
Reference in New Issue
Block a user