feat(git): add ignore and untrack paths commands

The changes introduce server-side commands to manage gitignore
 rules and to untrack paths without deleting local files.
 A new GitIgnoreKind enum and helper functions normalize targets
 and build proper ignore patterns, and UI code was wired to use
 these commands.

- add_to_gitignore command and related helpers
- untrack_paths command to remove paths from the index
- UI wiring to expose ignore and untrack actions in explorer
This commit is contained in:
Christoph Brandau
2026-08-18 13:09:33 +02:00
parent a4936ba790
commit e4697c74b6
11 changed files with 608 additions and 53 deletions
+9
View File
@@ -14,6 +14,7 @@ import type {
GitBranch,
GitCommit,
GitCommitComparison,
GitIgnoreKind,
GitLfsStatus,
GitRepositoryFile,
GitRemote,
@@ -291,6 +292,14 @@ export function unstageFiles(path: string, files: string[]): Promise<GitStatus>
return invoke<GitStatus>("unstage_files", { path, files });
}
export function addToGitignore(path: string, target: string, kind: GitIgnoreKind): Promise<GitStatus> {
return invoke<GitStatus>("add_to_gitignore", { path, target, kind });
}
export function untrackPaths(path: string, targets: string[]): Promise<GitStatus> {
return invoke<GitStatus>("untrack_paths", { path, targets });
}
export function restoreFiles(
path: string,
files: string[],