From 4aaed77705081009fe9e3d7025b545108f7db205 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sat, 28 Feb 2026 18:32:21 -0800 Subject: Remove git worktree/branch management Session-scoped artifacts already solve the concurrent session problem. No need for worktrees or branches. Simpler is better. --- src/main/ipc/handlers.ts | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'src/main/ipc') diff --git a/src/main/ipc/handlers.ts b/src/main/ipc/handlers.ts index bc0d024..2d5e3d3 100644 --- a/src/main/ipc/handlers.ts +++ b/src/main/ipc/handlers.ts @@ -3,7 +3,6 @@ import * as projects from "../db/projects"; import * as sessions from "../db/sessions"; import * as claude from "../claude"; import type { UserPermissionMode } from "../claude/phases"; -import * as git from "../git/worktree"; export function registerIpcHandlers(mainWindow: BrowserWindow): void { // Projects @@ -19,35 +18,16 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void { ipcMain.handle("sessions:list", (_, projectId: string) => sessions.listSessions(projectId) ); - - ipcMain.handle("sessions:create", async (_, projectId: string, name: string) => { - const session = sessions.createSession(projectId, name); - const project = projects.getProject(projectId); - - if (project && git.isGitRepo(project.path)) { - try { - // Create git worktree for this session - git.createWorktree(project.path, session.id); - } catch (error) { - console.error("Failed to create worktree:", error); - // Continue without worktree - not fatal - } - } - - return session; - }); + + ipcMain.handle("sessions:create", (_, projectId: string, name: string) => + sessions.createSession(projectId, name) + ); ipcMain.handle("sessions:delete", (_, id: string) => { const session = sessions.getSession(id); if (session) { const project = projects.getProject(session.project_id); if (project) { - // Clean up worktree if exists - try { - git.removeWorktree(project.path, id); - } catch { - // Worktree might not exist, that's ok - } // Clean up session artifacts claude.clearSessionArtifacts(project.path, id); } @@ -162,23 +142,6 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void { } ); - // Git - ipcMain.handle("git:isRepo", (_, projectPath: string) => { - return git.isGitRepo(projectPath); - }); - - ipcMain.handle("git:worktreeInfo", (_, projectPath: string, sessionId: string) => { - return git.getWorktreeInfo(projectPath, sessionId); - }); - - ipcMain.handle("git:commit", (_, worktreePath: string, message: string, files?: string[]) => { - git.commitChanges(worktreePath, message, files); - }); - - ipcMain.handle("git:hasChanges", (_, worktreePath: string) => { - return git.hasUncommittedChanges(worktreePath); - }); - // Dialogs ipcMain.handle("dialog:selectDirectory", async () => { const result = await dialog.showOpenDialog(mainWindow, { -- cgit v1.2.3