Fix git branches in non-active repository (#26148)

Release Notes:

- Git Beta: Fixed a bug where the branch selector would only show for
the first repository opened.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
Mikayla Maki 2025-03-05 13:16:46 -08:00 committed by GitHub
parent 2a919ad1d0
commit 9d54e63a11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 316 additions and 299 deletions

View file

@ -48,7 +48,7 @@ use image_store::{ImageItemEvent, ImageStoreEvent};
use ::git::{
blame::Blame,
repository::{Branch, GitRepository, RepoPath},
repository::{GitRepository, RepoPath},
status::FileStatus,
};
use gpui::{
@ -3705,21 +3705,6 @@ impl Project {
worktree.get_local_repo(&root_entry)?.repo().clone().into()
}
pub fn branches(&self, project_path: ProjectPath, cx: &App) -> Task<Result<Vec<Branch>>> {
self.worktree_store().read(cx).branches(project_path, cx)
}
pub fn update_or_create_branch(
&self,
repository: ProjectPath,
new_branch: String,
cx: &App,
) -> Task<Result<()>> {
self.worktree_store()
.read(cx)
.update_or_create_branch(repository, new_branch, cx)
}
pub fn blame_buffer(
&self,
buffer: &Entity<Buffer>,