mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
Source Generated Regex
This commit is contained in:
parent
f93dec5e6a
commit
c0a079de41
19 changed files with 101 additions and 64 deletions
|
@ -2,9 +2,11 @@
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
public class AssumeUnchanged {
|
||||
class ViewCommand : Command {
|
||||
private static readonly Regex REG = new Regex(@"^(\w)\s+(.+)$");
|
||||
public partial class AssumeUnchanged {
|
||||
partial class ViewCommand : Command {
|
||||
|
||||
[GeneratedRegex(@"^(\w)\s+(.+)$")]
|
||||
private static partial Regex REG();
|
||||
|
||||
public ViewCommand(string repo) {
|
||||
WorkingDirectory = repo;
|
||||
|
@ -18,7 +20,7 @@ namespace SourceGit.Commands {
|
|||
}
|
||||
|
||||
protected override void OnReadline(string line) {
|
||||
var match = REG.Match(line);
|
||||
var match = REG().Match(line);
|
||||
if (!match.Success) return;
|
||||
|
||||
if (match.Groups[1].Value == "h") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue