upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/list.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-12-20 10:25:22 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-12-20 10:25:22 +0000
commit97de61aef110414bad8a1a3f8506e9c1efb37402 (patch)
treeeee50aff78624b30ff9960d181df5adefdd29ea8 /src/bin/git_remote_nostr/list.rs
parent4bab25d575fa82785a424038e517b09e9485bad3 (diff)
feat(remote): include draft PRs
show draft as well as open PRs as remote branches
Diffstat (limited to 'src/bin/git_remote_nostr/list.rs')
-rw-r--r--src/bin/git_remote_nostr/list.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index f361272..b802a4a 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -22,7 +22,7 @@ use crate::{
22 fetch::{fetch_from_git_server, make_commits_for_proposal}, 22 fetch::{fetch_from_git_server, make_commits_for_proposal},
23 git::Repo, 23 git::Repo,
24 utils::{ 24 utils::{
25 Direction, fetch_or_list_error_is_not_authentication_failure, get_open_proposals, 25 Direction, fetch_or_list_error_is_not_authentication_failure, get_open_or_draft_proposals,
26 get_read_protocols_to_try, get_short_git_server_name, join_with_and, 26 get_read_protocols_to_try, get_short_git_server_name, join_with_and,
27 set_protocol_preference, 27 set_protocol_preference,
28 }, 28 },
@@ -93,7 +93,7 @@ pub async fn run_list(
93 state.retain(|k, _| !k.starts_with("refs/heads/pr/")); 93 state.retain(|k, _| !k.starts_with("refs/heads/pr/"));
94 94
95 let proposals_state = 95 let proposals_state =
96 get_open_proposals_state(&term, git_repo, repo_ref, &remote_states).await?; 96 get_open_and_draft_proposals_state(&term, git_repo, repo_ref, &remote_states).await?;
97 97
98 state.extend(proposals_state); 98 state.extend(proposals_state);
99 99
@@ -113,7 +113,7 @@ pub async fn run_list(
113 Ok(remote_states) 113 Ok(remote_states)
114} 114}
115 115
116async fn get_open_proposals_state( 116async fn get_open_and_draft_proposals_state(
117 term: &console::Term, 117 term: &console::Term,
118 git_repo: &Repo, 118 git_repo: &Repo,
119 repo_ref: &RepoRef, 119 repo_ref: &RepoRef,
@@ -145,9 +145,9 @@ async fn get_open_proposals_state(
145 } 145 }
146 146
147 let mut state = HashMap::new(); 147 let mut state = HashMap::new();
148 let open_proposals = get_open_proposals(git_repo, repo_ref).await?; 148 let open_and_draft_proposals = get_open_or_draft_proposals(git_repo, repo_ref).await?;
149 let current_user = get_curent_user(git_repo)?; 149 let current_user = get_curent_user(git_repo)?;
150 for (_, (proposal, patches)) in open_proposals { 150 for (_, (proposal, patches)) in open_and_draft_proposals {
151 if let Ok(cl) = event_to_cover_letter(&proposal) { 151 if let Ok(cl) = event_to_cover_letter(&proposal) {
152 if let Ok(mut branch_name) = cl.get_branch_name_with_pr_prefix_and_shorthand_id() { 152 if let Ok(mut branch_name) = cl.get_branch_name_with_pr_prefix_and_shorthand_id() {
153 branch_name = if let Some(public_key) = current_user { 153 branch_name = if let Some(public_key) = current_user {