mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
[wip] support multiple remotes
This commit is contained in:
parent
9782eb7b1f
commit
d846174c38
3 changed files with 12 additions and 2 deletions
|
|
@ -71,8 +71,8 @@ pub use merge::{
|
|||
};
|
||||
pub use rebase::rebase_branch;
|
||||
pub use remotes::{
|
||||
get_default_remote, get_remotes, push::AsyncProgress,
|
||||
tags::PushTagsProgress,
|
||||
get_default_remote, get_remotes, has_default_remote,
|
||||
push::AsyncProgress, tags::PushTagsProgress,
|
||||
};
|
||||
pub(crate) use repository::repo;
|
||||
pub use repository::{RepoPath, RepoPathRef};
|
||||
|
|
|
|||
|
|
@ -85,6 +85,14 @@ pub(crate) fn get_default_remote_in_repo(
|
|||
Err(Error::NoDefaultRemoteFound)
|
||||
}
|
||||
|
||||
/// returns true based on result of `get_default_remote_in_repo` being anything but `NoDefaultRemoteFound`
|
||||
pub fn has_default_remote(repo: &Repository) -> bool {
|
||||
!matches!(
|
||||
get_default_remote_in_repo(repo),
|
||||
Err(Error::NoDefaultRemoteFound)
|
||||
)
|
||||
}
|
||||
|
||||
///
|
||||
fn fetch_from_remote(
|
||||
repo_path: &RepoPath,
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ impl PushComponent {
|
|||
(false, false) => PushComponentModifier::None,
|
||||
};
|
||||
|
||||
//TODO: check if branch is tracked on a remote or if we find a default remote if not go into a remote selection popup
|
||||
|
||||
self.show()?;
|
||||
|
||||
if need_username_password(&self.repo.borrow())? {
|
||||
|
|
|
|||
Loading…
Reference in a new issue