fix<Watcher>: goto repository's tab when it's already opened

This commit is contained in:
leo 2021-05-13 15:39:22 +08:00
parent 524eb8ef6d
commit d0b1fbd7fb

View file

@ -44,7 +44,10 @@ namespace SourceGit.Models {
/// </summary> /// </summary>
/// <param name="repo"></param> /// <param name="repo"></param>
public static void Open(Repository repo) { public static void Open(Repository repo) {
if (all.ContainsKey(repo.Path)) return; if (all.ContainsKey(repo.Path)) {
Opened?.Invoke(repo);
return;
}
var watcher = new Watcher(); var watcher = new Watcher();
watcher.Start(repo.Path, repo.GitDir); watcher.Start(repo.Path, repo.GitDir);