From d3c2541859a6aaa9574fe7c6285c1bdad6733c29 Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Sat, 9 May 2026 20:46:13 +0200 Subject: [PATCH] Fix "Branches are all up to date" error toast on integrate upstream Telemetry showed this was the most frequent error toast in v0.19.10. Users clicking "integrate upstream" when branches were already current got an error toast instead of a silent no-op. The `integrate_upstream` function in `upstream_integration.rs` matches on `StackStatuses::UpdatesRequired` and the else arm (the `UpToDate` case) called `bail!()`, which surfaced as an error toast in the frontend. Being up-to-date is a valid state, not an error. Replaced the `bail!()` with `Ok(IntegrationOutcome { deleted_branches: vec![] })` so the frontend handles it silently. --- crates/gitbutler-branch-actions/src/upstream_integration.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/gitbutler-branch-actions/src/upstream_integration.rs b/crates/gitbutler-branch-actions/src/upstream_integration.rs index 2e2fdb84629..9cadd2afec1 100644 --- a/crates/gitbutler-branch-actions/src/upstream_integration.rs +++ b/crates/gitbutler-branch-actions/src/upstream_integration.rs @@ -568,7 +568,9 @@ pub(crate) fn integrate_upstream( let statuses = upstream_integration_statuses(&context)?; let StackStatuses::UpdatesRequired { statuses, .. } = statuses else { - bail!("Branches are all up to date") + return Ok(IntegrationOutcome { + deleted_branches: vec![], + }); }; if resolutions.len() != context.stacks_in_workspace.len() {