From 97de61aef110414bad8a1a3f8506e9c1efb37402 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 20 Dec 2024 10:25:22 +0000 Subject: feat(remote): include draft PRs show draft as well as open PRs as remote branches --- src/bin/git_remote_nostr/utils.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/bin/git_remote_nostr/utils.rs') diff --git a/src/bin/git_remote_nostr/utils.rs b/src/bin/git_remote_nostr/utils.rs index 316fedb..5048ce2 100644 --- a/src/bin/git_remote_nostr/utils.rs +++ b/src/bin/git_remote_nostr/utils.rs @@ -94,7 +94,7 @@ pub fn read_line<'a>(stdin: &io::Stdin, line: &'a mut String) -> io::Result Result)>> { @@ -118,7 +118,7 @@ pub async fn get_open_proposals( statuses.reverse(); statuses }; - let mut open_proposals = HashMap::new(); + let mut open_or_draft_proposals = HashMap::new(); for proposal in proposals { let status = if let Some(e) = statuses @@ -136,7 +136,7 @@ pub async fn get_open_proposals( } else { Kind::GitStatusOpen }; - if status.eq(&Kind::GitStatusOpen) { + if [Kind::GitStatusOpen, Kind::GitStatusDraft].contains(&status) { if let Ok(commits_events) = get_all_proposal_patch_events_from_cache(git_repo_path, repo_ref, &proposal.id) .await @@ -144,13 +144,13 @@ pub async fn get_open_proposals( if let Ok(most_recent_proposal_patch_chain) = get_most_recent_patch_with_ancestors(commits_events.clone()) { - open_proposals + open_or_draft_proposals .insert(proposal.id, (proposal, most_recent_proposal_patch_chain)); } } } } - Ok(open_proposals) + Ok(open_or_draft_proposals) } pub async fn get_all_proposals( -- cgit v1.2.3