Fix origin/master showing in sidebar

This commit is contained in:
Caleb Owens 2024-05-30 13:56:39 +02:00
parent 93d019afce
commit 251424d567
2 changed files with 9 additions and 3 deletions

View File

@ -77,6 +77,14 @@ impl Refname {
Refname::Other(raw) => raw.to_string(),
}
}
pub fn remote(&self) -> Option<&str> {
match self {
Self::Remote(remote) => Some(remote.remote()),
Self::Local(remote) => remote.remote().map(|remote| remote.remote()),
_ => None,
}
}
}
impl FromStr for Refname {

View File

@ -67,10 +67,8 @@ pub fn list_remote_branches(
let branch = branch_to_remote_branch(&branch)?;
if let Some(branch) = branch {
let upstream_remote = branch.upstream.as_ref().map(|u| u.remote());
let branch_is_trunk = branch.name.branch() == Some(default_target.branch.branch())
&& upstream_remote == Some(default_target.branch.remote());
&& branch.name.remote() == Some(default_target.branch.remote());
if !branch_is_trunk
&& branch.name.branch() != Some("gitbutler/integration")