Skip to content

Commit a273cad

Browse files
committed
fix: worktree file status not updated (#2011)
Signed-off-by: leo <[email protected]>
1 parent 120a331 commit a273cad

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Models/Watcher.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,13 @@ private void HandleWorkingCopyFileChanged(string name, string fullpath)
333333

334334
private bool IsInSubmodule(string folder)
335335
{
336+
if (string.IsNullOrEmpty(folder) || folder.Equals(_root, StringComparison.Ordinal))
337+
return false;
338+
336339
if (File.Exists($"{folder}/.git"))
337340
return true;
338341

339-
var parent = Path.GetDirectoryName(folder);
340-
if (parent == null || parent.Equals(_root, StringComparison.Ordinal))
341-
return false;
342-
343-
return IsInSubmodule(parent);
342+
return IsInSubmodule(Path.GetDirectoryName(folder));
344343
}
345344

346345
private readonly IRepository _repo;

0 commit comments

Comments
 (0)