mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Move git sync operations directly into GitSyncProvider
This commit is contained in:
4 files changed
+196
-138
No files matched your search
@@ -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);
|
||||
Reference in new issue
Block a user