mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-28 22:03:30 +03:00
Allow non-origin main branches to be listed
This commit is contained in:
parent
27f3b65b79
commit
571f16b8b2
@ -3,7 +3,6 @@ use super::{
|
||||
TreeBuilder, Url,
|
||||
};
|
||||
use crate::path::Normalize;
|
||||
use git2::string_array::StringArray;
|
||||
use git2::{BlameOptions, Submodule};
|
||||
use git2_hooks::HookResult;
|
||||
#[cfg(unix)]
|
||||
@ -12,7 +11,6 @@ use std::os::unix::fs::PermissionsExt;
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::process::Stdio;
|
||||
use std::{io::Write, path::Path, str};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
// wrapper around git2::Repository to get control over how it's used.
|
||||
pub struct Repository(git2::Repository);
|
||||
|
@ -65,8 +65,14 @@ pub fn list_remote_branches(
|
||||
.flatten()
|
||||
{
|
||||
let branch = branch_to_remote_branch(&branch)?;
|
||||
|
||||
if let Some(branch) = branch {
|
||||
if branch.name.branch() != Some(default_target.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());
|
||||
|
||||
if !branch_is_trunk
|
||||
&& branch.name.branch() != Some("gitbutler/integration")
|
||||
&& branch.name.branch() != Some("gitbutler/target")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user