mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
Source Generated Regex
This commit is contained in:
parent
f93dec5e6a
commit
c0a079de41
19 changed files with 101 additions and 64 deletions
|
@ -3,8 +3,9 @@ using System.Collections.Generic;
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SourceGit.Commands {
|
||||
public class QueryLocalChanges : Command {
|
||||
private static readonly Regex REG_FORMAT = new Regex(@"^(\s?[\w\?]{1,4})\s+(.+)$");
|
||||
public partial class QueryLocalChanges : Command {
|
||||
[GeneratedRegex(@"^(\s?[\w\?]{1,4})\s+(.+)$")]
|
||||
private static partial Regex REG_FORMAT();
|
||||
private static readonly string[] UNTRACKED = [ "no", "all" ];
|
||||
|
||||
public QueryLocalChanges(string repo, bool includeUntracked = true) {
|
||||
|
@ -19,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;
|
||||
if (line.EndsWith("/", StringComparison.Ordinal)) return; // Ignore changes with git-worktree
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue