feat: add git stash management
Add a Stashes dialog with create, apply, pop, and drop actions Include untracked files automatically when stashing Show file counts for current changes and stash entries
This commit is contained in:
@@ -546,6 +546,42 @@ export async function gitFetch(
|
||||
return gitHttp.gitFetch(directory, options);
|
||||
}
|
||||
|
||||
export async function listGitStashes(directory: string): Promise<{ stashes: import('./api/types').GitStashEntry[] }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.listGitStashes(directory);
|
||||
return gitHttp.listGitStashes(directory);
|
||||
}
|
||||
|
||||
export async function countGitStashFiles(directory: string, refs: string[]): Promise<{ counts: Record<string, number> }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.countGitStashFiles(directory, refs);
|
||||
return gitHttp.countGitStashFiles(directory, refs);
|
||||
}
|
||||
|
||||
export async function stashGitChanges(directory: string, options: { message?: string } = {}): Promise<{ success: boolean; created: boolean; message: string; output: string }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.stashGitChanges(directory, options);
|
||||
return gitHttp.stashGitChanges(directory, options);
|
||||
}
|
||||
|
||||
export async function applyGitStash(directory: string, options: { ref: string }): Promise<{ success: boolean; ref: string }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.applyGitStash(directory, options);
|
||||
return gitHttp.applyGitStash(directory, options);
|
||||
}
|
||||
|
||||
export async function popGitStash(directory: string, options: { ref: string }): Promise<{ success: boolean; ref: string }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.popGitStash(directory, options);
|
||||
return gitHttp.popGitStash(directory, options);
|
||||
}
|
||||
|
||||
export async function dropGitStash(directory: string, options: { ref: string }): Promise<{ success: boolean; ref: string }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.dropGitStash(directory, options);
|
||||
return gitHttp.dropGitStash(directory, options);
|
||||
}
|
||||
|
||||
export async function checkoutBranch(directory: string, branch: string): Promise<{ success: boolean; branch: string }> {
|
||||
const runtime = getRuntimeGit();
|
||||
if (runtime) return runtime.checkoutBranch(directory, branch);
|
||||
|
||||
Reference in New Issue
Block a user