upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/push.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/push.rs')
-rw-r--r--src/bin/git_remote_nostr/push.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs
index 7161c5d..381a45e 100644
--- a/src/bin/git_remote_nostr/push.rs
+++ b/src/bin/git_remote_nostr/push.rs
@@ -92,7 +92,7 @@ pub async fn run_push(
92 list_outputs.get(url).unwrap().to_owned() 92 list_outputs.get(url).unwrap().to_owned()
93 } else { 93 } else {
94 bail!( 94 bail!(
95 "cannot connect to git servers: {}", 95 "failed to connect to git servers: {}",
96 repo_ref.git_server.join(" ") 96 repo_ref.git_server.join(" ")
97 ); 97 );
98 } 98 }
@@ -245,7 +245,7 @@ pub async fn run_push(
245 &[], 245 &[],
246 ) 246 )
247 .await 247 .await
248 .context("cannot make patch event from commit")?; 248 .context("failed to make patch event from commit")?;
249 events.push(new_patch.clone()); 249 events.push(new_patch.clone());
250 parent_patch = new_patch; 250 parent_patch = new_patch;
251 } 251 }
@@ -259,7 +259,7 @@ pub async fn run_push(
259 ) 259 )
260 .unwrap(); 260 .unwrap();
261 println!( 261 println!(
262 "error {to} cannot fastforward as newer patches found on proposal" 262 "error {to} failed to fastforward as newer patches found on proposal"
263 ); 263 );
264 rejected_proposal_refspecs.push(refspec.to_string()); 264 rejected_proposal_refspecs.push(refspec.to_string());
265 } 265 }
@@ -1089,7 +1089,7 @@ fn update_remote_refs_pushed(
1089 } 1089 }
1090 } else { 1090 } else {
1091 let commit = reference_to_commit(git_repo, from) 1091 let commit = reference_to_commit(git_repo, from)
1092 .context(format!("cannot get commit of reference {from}"))?; 1092 .context(format!("failed to get commit of reference {from}"))?;
1093 if let Ok(mut remote_ref) = git_repo.find_reference(&target_ref_name) { 1093 if let Ok(mut remote_ref) = git_repo.find_reference(&target_ref_name) {
1094 remote_ref.set_target(commit, "updated by nostr remote helper")?; 1094 remote_ref.set_target(commit, "updated by nostr remote helper")?;
1095 } else { 1095 } else {
@@ -1142,9 +1142,9 @@ fn refspec_remote_ref_name(
1142fn reference_to_commit(git_repo: &Repository, reference: &str) -> Result<Oid> { 1142fn reference_to_commit(git_repo: &Repository, reference: &str) -> Result<Oid> {
1143 Ok(git_repo 1143 Ok(git_repo
1144 .find_reference(reference) 1144 .find_reference(reference)
1145 .context(format!("cannot find reference: {reference}"))? 1145 .context(format!("failed to find reference: {reference}"))?
1146 .peel_to_commit() 1146 .peel_to_commit()
1147 .context(format!("cannot get commit from reference: {reference}"))? 1147 .context(format!("failed to get commit from reference: {reference}"))?
1148 .id()) 1148 .id())
1149} 1149}
1150 1150
@@ -1152,13 +1152,13 @@ fn reference_to_commit(git_repo: &Repository, reference: &str) -> Result<Oid> {
1152fn reference_to_ref_value(git_repo: &Repository, reference: &str) -> Result<String> { 1152fn reference_to_ref_value(git_repo: &Repository, reference: &str) -> Result<String> {
1153 let reference_obj = git_repo 1153 let reference_obj = git_repo
1154 .find_reference(reference) 1154 .find_reference(reference)
1155 .context(format!("cannot find reference: {reference}"))?; 1155 .context(format!("failed to find reference: {reference}"))?;
1156 if let Some(symref) = reference_obj.symbolic_target() { 1156 if let Some(symref) = reference_obj.symbolic_target() {
1157 Ok(symref.to_string()) 1157 Ok(symref.to_string())
1158 } else { 1158 } else {
1159 Ok(reference_obj 1159 Ok(reference_obj
1160 .peel_to_commit() 1160 .peel_to_commit()
1161 .context(format!("cannot get commit from reference: {reference}"))? 1161 .context(format!("failed to get commit from reference: {reference}"))?
1162 .id() 1162 .id()
1163 .to_string()) 1163 .to_string())
1164 } 1164 }