Merge pull request #116 from gadfly3173/fix/worktree-branch-switch

fix: Fixed the problem that the switching branch of the worktree repo…
This commit is contained in:
leo 2024-05-07 10:38:56 +08:00 committed by GitHub
commit 6cd550af4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -180,7 +180,8 @@ namespace SourceGit.Models
}
else if (name.Equals("HEAD", StringComparison.Ordinal) ||
name.StartsWith("refs/heads/", StringComparison.Ordinal) ||
name.StartsWith("refs/remotes/", StringComparison.Ordinal))
name.StartsWith("refs/remotes/", StringComparison.Ordinal) ||
(name.StartsWith("worktrees/", StringComparison.Ordinal) && name.EndsWith("/HEAD", StringComparison.Ordinal)))
{
_updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime();
}