upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/utils.rs')
-rw-r--r--src/bin/git_remote_nostr/utils.rs10
1 files changed, 5 insertions, 5 deletions
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<Vec<
94 Ok(tokens) 94 Ok(tokens)
95} 95}
96 96
97pub async fn get_open_proposals( 97pub async fn get_open_or_draft_proposals(
98 git_repo: &Repo, 98 git_repo: &Repo,
99 repo_ref: &RepoRef, 99 repo_ref: &RepoRef,
100) -> Result<HashMap<EventId, (Event, Vec<Event>)>> { 100) -> Result<HashMap<EventId, (Event, Vec<Event>)>> {
@@ -118,7 +118,7 @@ pub async fn get_open_proposals(
118 statuses.reverse(); 118 statuses.reverse();
119 statuses 119 statuses
120 }; 120 };
121 let mut open_proposals = HashMap::new(); 121 let mut open_or_draft_proposals = HashMap::new();
122 122
123 for proposal in proposals { 123 for proposal in proposals {
124 let status = if let Some(e) = statuses 124 let status = if let Some(e) = statuses
@@ -136,7 +136,7 @@ pub async fn get_open_proposals(
136 } else { 136 } else {
137 Kind::GitStatusOpen 137 Kind::GitStatusOpen
138 }; 138 };
139 if status.eq(&Kind::GitStatusOpen) { 139 if [Kind::GitStatusOpen, Kind::GitStatusDraft].contains(&status) {
140 if let Ok(commits_events) = 140 if let Ok(commits_events) =
141 get_all_proposal_patch_events_from_cache(git_repo_path, repo_ref, &proposal.id) 141 get_all_proposal_patch_events_from_cache(git_repo_path, repo_ref, &proposal.id)
142 .await 142 .await
@@ -144,13 +144,13 @@ pub async fn get_open_proposals(
144 if let Ok(most_recent_proposal_patch_chain) = 144 if let Ok(most_recent_proposal_patch_chain) =
145 get_most_recent_patch_with_ancestors(commits_events.clone()) 145 get_most_recent_patch_with_ancestors(commits_events.clone())
146 { 146 {
147 open_proposals 147 open_or_draft_proposals
148 .insert(proposal.id, (proposal, most_recent_proposal_patch_chain)); 148 .insert(proposal.id, (proposal, most_recent_proposal_patch_chain));
149 } 149 }
150 } 150 }
151 } 151 }
152 } 152 }
153 Ok(open_proposals) 153 Ok(open_or_draft_proposals)
154} 154}
155 155
156pub async fn get_all_proposals( 156pub async fn get_all_proposals(