Conversation
Introduces crates/git/ with: - GitRepository: main handle using git2 for fast in-process reads - GitBinary: wrapper around system git binary for write operations - Branch operations: list (git2), create/checkout/delete (CLI) - Worktree operations: list/create/remove/find (CLI) with porcelain parsing - Types: Branch, Worktree, RepoInfo - 18 tests covering parsing, git2 reads, and CLI integration Uses git2 0.20 with vendored-libgit2 (same approach as Zed). Worktree path convention: ../.worktrees/<repo>/<sanitized-branch>
- Add worktree_path and branch fields to SessionConfig - Add effective_project_path() helper that prefers worktree over init_path - Update agent runner, sub-agent, and sandbox registration to use effective_project_path() for CWD resolution - Add set_session_worktree() to SessionManager for mid-session switching - Add BackendEvent variants: ListBranchesAndWorktrees, SwitchWorktree, CreateWorktree with corresponding BackendResponse types - Implement backend handlers with git repo open, branch listing, worktree creation (with reuse of existing worktrees), and worktree switching - Refactor git crate worktree operations to free functions (avoids git2::Repository Send/Sync issues in async contexts) - Add git crate as dependency to code-assistant - Handle new responses in both GPUI and terminal UI backends
- Create WorktreeSelector component (analogous to ModelSelector/SandboxSelector) with Local, existing worktree, and 'New worktree...' options - Add WorktreeSelectorEvent variants: SwitchedToLocal, SwitchedToWorktree, CreateNewWorktreeRequested, RefreshRequested - Integrate into InputArea layout between model and sandbox selectors - Add InputAreaEvent variants for worktree operations - Wire up RootView event handler to dispatch BackendEvents for SwitchWorktree, ListBranchesAndWorktrees - Add TODO placeholders in GPUI response handler for updating WorktreeSelector when backend data arrives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.