From f1f21d8c83923a8813271b0e4d06a281bd471e28 Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Mon, 23 Mar 2026 17:14:35 +0100 Subject: [PATCH] agent: Make branch diff completion use same default branch as branch diff action (#52223) ## Context Before this change the branch diff would compare with local main instead of upstream main. This causes confusion because it's a different diff than the branch diff action would show users, and cause agents to potentially review a much larger diff then it has too. ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- crates/agent_ui/src/completion_provider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/agent_ui/src/completion_provider.rs b/crates/agent_ui/src/completion_provider.rs index 1c81ae85845e2c8a92f9c5dff9eb7d2d35ccd98b..5597aec7a66edd8561caa4ac53f672d5bd2a33ab 100644 --- a/crates/agent_ui/src/completion_provider.rs +++ b/crates/agent_ui/src/completion_provider.rs @@ -874,7 +874,7 @@ impl PromptCompletionProvider { let project = workspace.read(cx).project().clone(); let repo = project.read(cx).active_repository(cx)?; - let default_branch_receiver = repo.update(cx, |repo, _| repo.default_branch(false)); + let default_branch_receiver = repo.update(cx, |repo, _| repo.default_branch(true)); Some(cx.spawn(async move |_cx| { let base_ref = default_branch_receiver