mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
refactor<*>: rewrite all with AvaloniaUI
This commit is contained in:
parent
0136904612
commit
2a62596999
521 changed files with 19780 additions and 23244 deletions
18
src/Commands/IsBinary.cs
Normal file
18
src/Commands/IsBinary.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
public class IsBinary : Command {
|
||||
private static readonly Regex REG_TEST = new Regex(@"^\-\s+\-\s+.*$");
|
||||
|
||||
public IsBinary(string repo, string commit, string path) {
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 {commit} --numstat -- \"{path}\"";
|
||||
RaiseError = false;
|
||||
}
|
||||
|
||||
public bool Result() {
|
||||
return REG_TEST.IsMatch(ReadToEnd().StdOut);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue