diff options
Diffstat (limited to 'src/bin/git_remote_nostr/fetch.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/fetch.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs index 024a923..5ee4271 100644 --- a/src/bin/git_remote_nostr/fetch.rs +++ b/src/bin/git_remote_nostr/fetch.rs | |||
| @@ -25,8 +25,8 @@ use nostr_sdk::{Event, ToBech32}; | |||
| 25 | 25 | ||
| 26 | use crate::utils::{ | 26 | use crate::utils::{ |
| 27 | Direction, fetch_or_list_error_is_not_authentication_failure, | 27 | Direction, fetch_or_list_error_is_not_authentication_failure, |
| 28 | find_proposal_and_patches_by_branch_name, get_oids_from_fetch_batch, get_open_proposals, | 28 | find_proposal_and_patches_by_branch_name, get_oids_from_fetch_batch, |
| 29 | get_read_protocols_to_try, join_with_and, set_protocol_preference, | 29 | get_open_or_draft_proposals, get_read_protocols_to_try, join_with_and, set_protocol_preference, |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | pub async fn run_fetch( | 32 | pub async fn run_fetch( |
| @@ -79,7 +79,7 @@ pub async fn run_fetch( | |||
| 79 | 79 | ||
| 80 | fetch_batch.retain(|refstr, _| refstr.contains("refs/heads/pr/")); | 80 | fetch_batch.retain(|refstr, _| refstr.contains("refs/heads/pr/")); |
| 81 | 81 | ||
| 82 | fetch_proposals(git_repo, &term, repo_ref, &fetch_batch).await?; | 82 | fetch_open_or_draft_proposals(git_repo, &term, repo_ref, &fetch_batch).await?; |
| 83 | term.flush()?; | 83 | term.flush()?; |
| 84 | println!(); | 84 | println!(); |
| 85 | Ok(()) | 85 | Ok(()) |
| @@ -128,21 +128,21 @@ pub fn make_commits_for_proposal( | |||
| 128 | Ok(tip_commit_id) | 128 | Ok(tip_commit_id) |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | async fn fetch_proposals( | 131 | async fn fetch_open_or_draft_proposals( |
| 132 | git_repo: &Repo, | 132 | git_repo: &Repo, |
| 133 | term: &console::Term, | 133 | term: &console::Term, |
| 134 | repo_ref: &RepoRef, | 134 | repo_ref: &RepoRef, |
| 135 | proposal_refs: &HashMap<String, String>, | 135 | proposal_refs: &HashMap<String, String>, |
| 136 | ) -> Result<()> { | 136 | ) -> Result<()> { |
| 137 | if !proposal_refs.is_empty() { | 137 | if !proposal_refs.is_empty() { |
| 138 | let open_proposals = get_open_proposals(git_repo, repo_ref).await?; | 138 | let open_and_draft_proposals = get_open_or_draft_proposals(git_repo, repo_ref).await?; |
| 139 | 139 | ||
| 140 | let current_user = get_curent_user(git_repo)?; | 140 | let current_user = get_curent_user(git_repo)?; |
| 141 | 141 | ||
| 142 | for refstr in proposal_refs.keys() { | 142 | for refstr in proposal_refs.keys() { |
| 143 | if let Some((_, (_, patches))) = find_proposal_and_patches_by_branch_name( | 143 | if let Some((_, (_, patches))) = find_proposal_and_patches_by_branch_name( |
| 144 | refstr, | 144 | refstr, |
| 145 | &open_proposals, | 145 | &open_and_draft_proposals, |
| 146 | current_user.as_ref(), | 146 | current_user.as_ref(), |
| 147 | ) { | 147 | ) { |
| 148 | if let Err(error) = make_commits_for_proposal(git_repo, repo_ref, patches) { | 148 | if let Err(error) = make_commits_for_proposal(git_repo, repo_ref, patches) { |