Single branch project starting#14674
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a metadata-only “set target ref” initialization path to support single-branch mode: projects can be initialized (target ref + related metadata) without switching the user onto gitbutler/workspace, and the UI messaging/flows are updated accordingly.
Changes:
- Introduces
set_target_ref_and_init_projectinbut-workspaceand exposes it throughbut-api(server/Tauri/SDK) for setting target metadata without changing the checked-out branch. - Updates Desktop + Lite clients to call the new command when
singleBranchis enabled, including UI copy/loading states that no longer imply a branch switch. - Adds Rust tests + Playwright coverage for the single-branch onboarding path and supporting e2e git assertions.
Reviewed changes
Copilot reviewed 22 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/but-sdk/src/generated/linear/index.js | Re-exports the new native binding entrypoint in the Linear build. |
| packages/but-sdk/src/generated/linear/index.d.ts | Adds TS declaration/docs for setTargetRefAndInitProject. |
| packages/but-sdk/src/generated/graph/index.js | Re-exports the new native binding entrypoint in the Graph build. |
| packages/but-sdk/src/generated/graph/index.d.ts | Adds TS declaration/docs for setTargetRefAndInitProject. |
| e2e/playwright/tests/singleBranch/addingAProject.spec.ts | New Playwright test asserting onboarding sets target metadata without switching to workspace. |
| e2e/playwright/src/branch.ts | Adds helper assertions for “ref does not exist” and “git config key equals value”. |
| crates/gitbutler-tauri/src/main.rs | Registers the new Tauri command handler. |
| crates/gitbutler-operating-modes/src/lib.rs | Makes outside-workspace metadata resilient to conflict computation failures (warn + empty conflicts). |
| crates/but-workspace/tests/workspace/main.rs | Wires new init test module into the workspace test suite. |
| crates/but-workspace/tests/workspace/init.rs | Adds thorough unit tests for metadata-only initialization behavior and error cases. |
| crates/but-workspace/tests/fixtures/scenario/init-project-with-origin.sh | New fixture scenario used by init tests (origin + fork remotes). |
| crates/but-workspace/src/lib.rs | Exposes new init module from but-workspace. |
| crates/but-workspace/src/init.rs | Implements set_target_ref_and_init_project (validate target, compute/repair metadata, persist config). |
| crates/but-server/src/lib.rs | Exposes the new endpoint route on the HTTP server. |
| crates/but-ctx/src/lib.rs | Refactors set_project_meta to use new ProjectMeta::persist helper and invalidate cache. |
| crates/but-core/src/ref_metadata.rs | Adds ProjectMeta::persist helper (persist local config + backfill legacy workspace metadata). |
| crates/but-api/src/workspace.rs | Adds NAPI/Tauri-exposed API wrapper for set_target_ref_and_init_project plus tests. |
| crates/but-api/src/branch.rs | Removes the older set_default_target implementation/tests in favor of the workspace API. |
| apps/lite/electron/src/preload.cts | Adds Lite Electron preload API method to invoke new IPC command. |
| apps/lite/electron/src/main.ts | Registers IPC handler calling SDK setTargetRefAndInitProject. |
| apps/lite/electron/src/ipc.ts | Adds IPC channel + params typing + API surface for the new action. |
| apps/desktop/src/lib/branches/branchEndpoints.ts | Adds a new backend mutation setTargetRef mapped to set_target_ref_and_init_project. |
| apps/desktop/src/lib/baseBranch/baseBranchService.svelte.ts | Exposes setTargetRef mutation via the base-branch service. |
| apps/desktop/src/components/onboarding/ProjectSetupTarget.svelte | Hides “GitButler switches your active branch…” messaging when singleBranch is enabled. |
| apps/desktop/src/components/onboarding/ProjectSetup.svelte | Onboarding uses metadata-only target set when singleBranch is enabled. |
| apps/desktop/src/components/forge/BaseBranchSwitch.svelte | Uses metadata-only target updates under singleBranch and adjusts loading label/state accordingly. |
87fb4f7 to
14fd5d3
Compare
14fd5d3 to
7a89c61
Compare
7a89c61 to
08b3df8
Compare
krlvi
approved these changes
Jul 12, 2026
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.