From c846a20d653ebaa547eba2ab52a19c311341bd7d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 28 Jul 2025 15:39:11 +0100 Subject: fix(remote): push all tags fiatjaf reported panic: ``` can not be successfully peeled into a tag (git_object_t=4). ``` when making a tag and running `git push --tags` I could not replicate but line it was coming from should use 'from' rather than 'to'. --- src/bin/git_remote_nostr/push.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/bin/git_remote_nostr/push.rs') diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index 4e0d760..9cf6dff 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -794,17 +794,19 @@ fn generate_updated_state( format!("{to}{}", "^{}"), git_repo .get_commit_or_tip_of_reference(from) - .unwrap() + .context(format!( + "cannot find commit from ref {from} to push to {to}" + ))? .to_string(), ); new_state.insert( to.to_string(), git_repo .git_repo - .find_reference(to) - .unwrap() + .find_reference(from) + .context(format!("cannot find ref {from} to push to {to}"))? .peel(git2::ObjectType::Tag) - .unwrap() + .context(format!("cannot find tag id {from} to push to {to}"))? .id() .to_string(), ); @@ -814,7 +816,9 @@ fn generate_updated_state( to.to_string(), git_repo .get_commit_or_tip_of_reference(from) - .unwrap() + .context(format!( + "cannot find commit from ref {from} to push to {to}" + ))? .to_string(), ); } -- cgit v1.2.3