Move git sync operations directly into GitSyncProvider

This commit is contained in:
Alex Gleason committed 2025-12-29 17:57:16 -06:00
1 parent b7081ea64a
commit 02cc069ff8
4 files changed
+196 -138

No files matched your search

+19 -2
View File
@@ -9,13 +9,30 @@ export interface GitSyncState {
error?: Error;
}
export interface FetchResult {
defaultBranch: string | null;
fetchHead: string | null;
fetchHeadDescription: string | null;
}
export interface GitSyncContextValue {
// State access
syncStates: Map<string, GitSyncState>;
getState: (dir: string) => GitSyncState | undefined;
getError: (dir: string) => Error | undefined;
// Git operations
fetch: (dir: string, remote?: string) => Promise<FetchResult>;
pull: (dir: string, ref: string, remote?: string) => Promise<void>;
push: (dir: string, ref: string, remote?: string, force?: boolean) => Promise<void>;
sync: (dir: string, ref: string, remote?: string) => Promise<void>;
forcePull: (dir: string, ref: string, remote?: string) => Promise<void>;
forcePush: (dir: string, ref: string, remote?: string) => Promise<void>;
// Internal state management (for backward compatibility during migration)
startOperation: (dir: string, operation: GitOperation) => void;
endOperation: (dir: string, error?: Error) => void;
setError: (dir: string, error: Error | null) => void;
getState: (dir: string) => GitSyncState | undefined;
getError: (dir: string) => Error | undefined;
}
export const GitSyncContext = createContext<GitSyncContextValue | null>(null);