fix(ui): warn and block save when a list's working dir isn't a git repo
Reuses RepoScanner.IsRepo (now public) to validate WorkingDir whenever it changes in ListSettingsModalViewModel — Browse or typing. A missing folder or a non-repo folder shows an inline warning and gates Save via the same CanExecute pattern the load-failure gate already uses; an empty WorkingDir is untouched. Previously this only surfaced as a Failed task deep in WorktreeManager on first run. Also localizes the two hardcoded EN strings in the same file (delete confirm, planning-sessions block) into vm.listSettings.* keys.
This commit is contained in:
@@ -69,5 +69,5 @@ public static class RepoScanner
|
||||
|
||||
// A real clone has .git as a directory. Worktrees and submodules have it as a file
|
||||
// ("gitdir: ...") — those are not standalone repos and would flood the list.
|
||||
private static bool IsRepo(string dir) => Directory.Exists(Path.Combine(dir, ".git"));
|
||||
public static bool IsRepo(string dir) => Directory.Exists(Path.Combine(dir, ".git"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user