fix: worktree file status not updated (#2011)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-12-26 20:34:16 +08:00
parent 120a331151
commit a273cad23b

View File

@@ -333,14 +333,13 @@ namespace SourceGit.Models
private bool IsInSubmodule(string folder)
{
if (string.IsNullOrEmpty(folder) || folder.Equals(_root, StringComparison.Ordinal))
return false;
if (File.Exists($"{folder}/.git"))
return true;
var parent = Path.GetDirectoryName(folder);
if (parent == null || parent.Equals(_root, StringComparison.Ordinal))
return false;
return IsInSubmodule(parent);
return IsInSubmodule(Path.GetDirectoryName(folder));
}
private readonly IRepository _repo;