mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
96d4150d26
* remove dotnet-tool.json because the project does not rely on any dotnet tools. * remove Directory.Build.props because the solution has only one project. * move src/SourceGit to src. It's not needed to put all sources into a subfolder of src since there's only one project.
23 lines
618 B
C#
23 lines
618 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace SourceGit.Commands
|
|
{
|
|
public partial class IsBinary : Command
|
|
{
|
|
[GeneratedRegex(@"^\-\s+\-\s+.*$")]
|
|
private static partial Regex REG_TEST();
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|