mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
Source Generated Regex
This commit is contained in:
parent
f93dec5e6a
commit
c0a079de41
19 changed files with 101 additions and 64 deletions
|
@ -2,8 +2,10 @@
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
public class QueryRevisionObjects : Command {
|
||||
private static readonly Regex REG_FORMAT = new Regex(@"^\d+\s+(\w+)\s+([0-9a-f]+)\s+(.*)$");
|
||||
public partial class QueryRevisionObjects : Command {
|
||||
|
||||
[GeneratedRegex(@"^\d+\s+(\w+)\s+([0-9a-f]+)\s+(.*)$")]
|
||||
private static partial Regex REG_FORMAT();
|
||||
private List<Models.Object> objects = new List<Models.Object>();
|
||||
|
||||
public QueryRevisionObjects(string repo, string sha) {
|
||||
|
@ -18,7 +20,7 @@ namespace SourceGit.Commands {
|
|||
}
|
||||
|
||||
protected override void OnReadline(string line) {
|
||||
var match = REG_FORMAT.Match(line);
|
||||
var match = REG_FORMAT().Match(line);
|
||||
if (!match.Success) return;
|
||||
|
||||
var obj = new Models.Object();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue