Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d846174

Browse files
[wip] support multiple remotes
1 parent 9782eb7 commit d846174

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

‎asyncgit/src/sync/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ pub use merge::{
7171
};
7272
pub use rebase::rebase_branch;
7373
pub use remotes::{
74-
get_default_remote, get_remotes, push::AsyncProgress,
75-
tags::PushTagsProgress,
74+
get_default_remote, get_remotes, has_default_remote,
75+
push::AsyncProgress,tags::PushTagsProgress,
7676
};
7777
pub(crate) use repository::repo;
7878
pub use repository::{RepoPath, RepoPathRef};

‎asyncgit/src/sync/remotes/mod.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ pub(crate) fn get_default_remote_in_repo(
8585
Err(Error::NoDefaultRemoteFound)
8686
}
8787

88+
/// returns true based on result of `get_default_remote_in_repo` being anything but `NoDefaultRemoteFound`
89+
pub fn has_default_remote(repo: &Repository) -> bool {
90+
!matches!(
91+
get_default_remote_in_repo(repo),
92+
Err(Error::NoDefaultRemoteFound)
93+
)
94+
}
95+
8896
///
8997
fn fetch_from_remote(
9098
repo_path: &RepoPath,

‎src/components/push.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ impl PushComponent {
109109
(false, false) => PushComponentModifier::None,
110110
};
111111

112+
//TODO: check if branch is tracked on a remote or if we find a default remote if not go into a remote selection popup
113+
112114
self.show()?;
113115

114116
if need_username_password(&self.repo.borrow())? {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /