diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs index 06288630..d10d8670 100644 --- a/src/Models/Watcher.cs +++ b/src/Models/Watcher.cs @@ -198,7 +198,12 @@ namespace SourceGit.Models (name.StartsWith("worktrees/", StringComparison.Ordinal) && name.EndsWith("/HEAD", StringComparison.Ordinal))) { _updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime(); - _updateSubmodules = DateTime.Now.AddSeconds(1).ToFileTime(); + + lock (_submodules) + { + if (_submodules.Count > 0) + _updateSubmodules = DateTime.Now.AddSeconds(1).ToFileTime(); + } } else if (name.StartsWith("objects/", StringComparison.Ordinal) || name.Equals("index", StringComparison.Ordinal)) {