Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

project: Fix branch diff with older servers (#62134)

Ben Kunkle41c0f28bf9ab
diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs
index 2272f0390cf..4512a0be5cd 100644
--- a/crates/project/src/git_store.rs
+++ b/crates/project/src/git_store.rs
@@ -8798,8 +8798,10 @@ impl Repository {
RepositoryState::Remote(RemoteRepositoryState { client, project_id }) => {
let (is_merge, includes_worktree, base, head) = match diff_type {
DiffTreeType::MergeBase { base, head } => (true, false, base, head),
+ // Older servers ignore `includes_worktree` and use the existing fields,
+ // so HEAD keeps this request valid as a committed-only fallback.
DiffTreeType::MergeBaseWithWorktree { base } => {
- (true, true, base, SharedString::default())
+ (true, true, base, "HEAD".into())
}
DiffTreeType::Since { base, head } => (false, false, base, head),
};