mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
Source Generated Regex
This commit is contained in:
parent
f93dec5e6a
commit
c0a079de41
19 changed files with 101 additions and 64 deletions
|
@ -1,8 +1,9 @@
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
public class IsBinary : Command {
|
||||
private static readonly Regex REG_TEST = new Regex(@"^\-\s+\-\s+.*$");
|
||||
public partial class IsBinary : Command {
|
||||
[GeneratedRegex(@"^\-\s+\-\s+.*$")]
|
||||
private static partial Regex REG_TEST();
|
||||
|
||||
public IsBinary(string repo, string commit, string path) {
|
||||
WorkingDirectory = repo;
|
||||
|
@ -12,7 +13,7 @@ namespace SourceGit.Commands {
|
|||
}
|
||||
|
||||
public bool Result() {
|
||||
return REG_TEST.IsMatch(ReadToEnd().StdOut);
|
||||
return REG_TEST().IsMatch(ReadToEnd().StdOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue