mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
feature<Watcher>: sync changes for git-worktrees
This commit is contained in:
parent
ee4aa052d2
commit
2ddc61e162
2 changed files with 5 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
@ -22,6 +23,7 @@ namespace SourceGit.Commands {
|
|||
public override void OnReadline(string line) {
|
||||
var match = REG_FORMAT.Match(line);
|
||||
if (!match.Success) return;
|
||||
if (line.EndsWith("/", StringComparison.Ordinal)) return; // Ignore changes with git-worktree
|
||||
|
||||
var change = new Models.Change() { Path = match.Groups[2].Value };
|
||||
var status = match.Groups[1].Value;
|
||||
|
|
|
@ -177,9 +177,10 @@ namespace SourceGit.Models {
|
|||
updateStashes = DateTime.Now.AddSeconds(.5).ToFileTime();
|
||||
} else if (e.Name.Equals("HEAD", StringComparison.Ordinal) ||
|
||||
e.Name.StartsWith("refs\\heads\\", StringComparison.Ordinal) ||
|
||||
e.Name.StartsWith("refs\\remotes\\", StringComparison.Ordinal)) {
|
||||
e.Name.StartsWith("refs\\remotes\\", StringComparison.Ordinal) ||
|
||||
e.Name.StartsWith("worktrees\\")) {
|
||||
updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime();
|
||||
} else if (e.Name.StartsWith("objects\\") || e.Name.Equals("index", StringComparison.Ordinal)) {
|
||||
} else if (e.Name.StartsWith("objects\\", StringComparison.Ordinal) || e.Name.Equals("index", StringComparison.Ordinal)) {
|
||||
updateWC = DateTime.Now.AddSeconds(.5).ToFileTime();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue