Skip to content

Commit 3e60811

Browse files
authored
feat: Refactor git service (#286)
1 parent cbf3594 commit 3e60811

File tree

17 files changed

+765
-809
lines changed

17 files changed

+765
-809
lines changed

apps/array/src/main/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { trpcRouter } from "./trpc/index.js";
3333
// Legacy type kept for backwards compatibility with taskControllers map
3434
type TaskController = unknown;
3535

36-
import { registerGitIpc } from "./services/git.js";
3736
import "./services/index.js";
3837
import type { DeepLinkService } from "./services/deep-link/service.js";
3938
import type { ExternalAppsService } from "./services/external-apps/service.js";
@@ -372,5 +371,4 @@ app.on("activate", () => {
372371
ipcMain.handle("app:get-version", () => app.getVersion());
373372

374373
// Register IPC handlers via services
375-
registerGitIpc();
376374
registerAgentIpc(taskControllers, () => mainWindow);

apps/array/src/main/preload.ts

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -80,61 +80,6 @@ contextBridge.exposeInMainWorld("electronAPI", {
8080
channel: string,
8181
listener: (payload: unknown) => void,
8282
): (() => void) => createIpcListener(channel, listener),
83-
// Git operations
84-
getChangedFilesHead: (
85-
repoPath: string,
86-
): Promise<Array<{ path: string; status: string; originalPath?: string }>> =>
87-
ipcRenderer.invoke("get-changed-files-head", repoPath),
88-
getFileAtHead: (repoPath: string, filePath: string): Promise<string | null> =>
89-
ipcRenderer.invoke("get-file-at-head", repoPath, filePath),
90-
getDiffStats: (
91-
repoPath: string,
92-
): Promise<{
93-
filesChanged: number;
94-
linesAdded: number;
95-
linesRemoved: number;
96-
}> => ipcRenderer.invoke("get-diff-stats", repoPath),
97-
getCurrentBranch: (repoPath: string): Promise<string | undefined> =>
98-
ipcRenderer.invoke("get-current-branch", repoPath),
99-
getDefaultBranch: (repoPath: string): Promise<string> =>
100-
ipcRenderer.invoke("get-default-branch", repoPath),
101-
getAllBranches: (repoPath: string): Promise<string[]> =>
102-
ipcRenderer.invoke("get-all-branches", repoPath),
103-
createBranch: (repoPath: string, branchName: string): Promise<void> =>
104-
ipcRenderer.invoke("create-branch", repoPath, branchName),
105-
discardFileChanges: (
106-
repoPath: string,
107-
filePath: string,
108-
fileStatus: string,
109-
): Promise<void> =>
110-
ipcRenderer.invoke("discard-file-changes", repoPath, filePath, fileStatus),
111-
getGitSyncStatus: (
112-
repoPath: string,
113-
): Promise<{
114-
ahead: number;
115-
behind: number;
116-
hasRemote: boolean;
117-
currentBranch: string | null;
118-
isFeatureBranch: boolean;
119-
}> => ipcRenderer.invoke("get-git-sync-status", repoPath),
120-
getLatestCommit: (
121-
repoPath: string,
122-
): Promise<{
123-
sha: string;
124-
shortSha: string;
125-
message: string;
126-
author: string;
127-
date: string;
128-
} | null> => ipcRenderer.invoke("get-latest-commit", repoPath),
129-
getGitRepoInfo: (
130-
repoPath: string,
131-
): Promise<{
132-
organization: string;
133-
repository: string;
134-
currentBranch: string | null;
135-
defaultBranch: string;
136-
compareUrl: string | null;
137-
} | null> => ipcRenderer.invoke("get-git-repo-info", repoPath),
13883
onOpenSettings: (listener: () => void): (() => void) =>
13984
createVoidIpcListener("open-settings", listener),
14085
onNewTask: (listener: () => void): (() => void) =>

0 commit comments

Comments
 (0)