Commit Graph

6 Commits

Author SHA1 Message Date
xintaofei
cc79d62b27 fix(git): surface non-git-repo as a typed error and align all panels via workspace state
Consolidate `.git` presence detection into a shared `git_repo` module used by both the workspace state watcher and the command preflight helper, replacing duplicated local definitions.

Introduce `AppErrorCode::NotAGitRepository` (HTTP 422) and preflight eleven frontend-callable git commands (log, status, list-branches, diff, diff-with-branch, show-diff, show-file, push-info, list-remotes, list-all-branches, commit-branches) so non-git folders short-circuit with a structured error instead of leaking locale-dependent git stderr.

Frontend `isNotAGitRepoError` checks the error code first and falls back to a multi-language regex list centralized in `src/i18n/git-error-patterns.ts`, covering the nine languages git actually translates into.

Wire the git log panel to `workspaceState.isGitRepo` rather than a local cached flag, so running `git init` or deleting `.git` externally propagates through the watcher and refreshes the panel automatically.
2026-04-18 23:07:13 +08:00
xintaofei
dacec69481 处理#[allow(dead_code)]代码 2026-03-07 18:04:36 +08:00
xintaofei
b1ea16fae0 移除Unknown错误码 2026-03-07 17:55:06 +08:00
xintaofei
dbcac80712 统一错误处理 2026-03-07 16:40:59 +08:00
xintaofei
6e5219cc10 继续多语言处理 2026-03-07 15:49:00 +08:00
xintaofei
6c48be023c 欢迎页面支持多语言 2026-03-07 12:17:57 +08:00