diff options
Diffstat (limited to 'src/bin/git_remote_nostr/list.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/list.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs index d06d202..7753ba1 100644 --- a/src/bin/git_remote_nostr/list.rs +++ b/src/bin/git_remote_nostr/list.rs | |||
| @@ -8,7 +8,7 @@ use ngit::{ | |||
| 8 | fetch::fetch_from_git_server, | 8 | fetch::fetch_from_git_server, |
| 9 | git::{self}, | 9 | git::{self}, |
| 10 | git_events::{KIND_PULL_REQUEST, KIND_PULL_REQUEST_UPDATE, event_to_cover_letter, tag_value}, | 10 | git_events::{KIND_PULL_REQUEST, KIND_PULL_REQUEST_UPDATE, event_to_cover_letter, tag_value}, |
| 11 | list::{generate_remote_sync_warnings, identify_remote_sync_issues, list_from_remotes}, | 11 | list::list_from_remotes, |
| 12 | login::get_curent_user, | 12 | login::get_curent_user, |
| 13 | repo_ref::{self}, | 13 | repo_ref::{self}, |
| 14 | utils::{get_all_proposals, get_open_or_draft_proposals}, | 14 | utils::{get_all_proposals, get_open_or_draft_proposals}, |
| @@ -27,23 +27,17 @@ pub async fn run_list( | |||
| 27 | 27 | ||
| 28 | let term = console::Term::stderr(); | 28 | let term = console::Term::stderr(); |
| 29 | 29 | ||
| 30 | term.write_line("git servers: listing refs...")?; | ||
| 30 | let remote_states = list_from_remotes( | 31 | let remote_states = list_from_remotes( |
| 31 | &term, | 32 | &term, |
| 32 | git_repo, | 33 | git_repo, |
| 33 | &repo_ref.git_server, | 34 | &repo_ref.git_server, |
| 34 | &repo_ref.to_nostr_git_url(&None), | 35 | &repo_ref.to_nostr_git_url(&None), |
| 35 | ); | 36 | nostr_state.as_ref(), |
| 37 | ) | ||
| 38 | .await; | ||
| 36 | 39 | ||
| 37 | let mut state = if let Some(nostr_state) = nostr_state { | 40 | let mut state = if let Some(nostr_state) = nostr_state { |
| 38 | // Identify sync issues using shared abstraction | ||
| 39 | let remote_issues = identify_remote_sync_issues(git_repo, &nostr_state, &remote_states); | ||
| 40 | |||
| 41 | // Generate and print warnings | ||
| 42 | let warnings = generate_remote_sync_warnings(&remote_issues, &remote_states); | ||
| 43 | for warning in warnings { | ||
| 44 | term.write_line(&warning)?; | ||
| 45 | } | ||
| 46 | |||
| 47 | nostr_state.state | 41 | nostr_state.state |
| 48 | } else { | 42 | } else { |
| 49 | let (state, _is_grasp_server) = repo_ref | 43 | let (state, _is_grasp_server) = repo_ref |