From 4831e5cba92809343bbb5f3be0d5a61883cdda86 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Wed, 7 Jan 2026 15:03:27 -0500 Subject: [PATCH] git: Fix project diff sorting not matching the git panel when tree view is in use (#46283) The tree view effectively always sorts by status, not by path. Release Notes: - Fixed incorrect ordering of paths in the project diff when using the git panel's tree view. --- crates/git_ui/src/project_diff.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/git_ui/src/project_diff.rs b/crates/git_ui/src/project_diff.rs index 5298f9c271cc5aa2c688e68b9f6e5a52ad58981f..2207b8c599ab34bec501485767bc342f01553bb8 100644 --- a/crates/git_ui/src/project_diff.rs +++ b/crates/git_ui/src/project_diff.rs @@ -716,8 +716,7 @@ impl ProjectDiff { fn sort_prefix(repo: &Repository, repo_path: &RepoPath, status: FileStatus, cx: &App) -> u64 { let settings = GitPanelSettings::get_global(cx); - // Tree view can only sort by path - if settings.sort_by_path || settings.tree_view { + if settings.sort_by_path && !settings.tree_view { TRACKED_SORT_PREFIX } else if repo.had_conflict_on_last_merge_head_change(repo_path) { CONFLICT_SORT_PREFIX