diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-28 15:39:11 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-28 15:41:24 +0100 |
| commit | c846a20d653ebaa547eba2ab52a19c311341bd7d (patch) | |
| tree | e93032d18768043679e55702040f777fe3a884d8 /src | |
| parent | caed1d751eb29d329119c1372c99a651980f42a4 (diff) | |
fix(remote): push all tags
fiatjaf reported panic:
```
<commit-id> 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'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/git_remote_nostr/push.rs | 14 |
1 files changed, 9 insertions, 5 deletions
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( | |||
| 794 | format!("{to}{}", "^{}"), | 794 | format!("{to}{}", "^{}"), |
| 795 | git_repo | 795 | git_repo |
| 796 | .get_commit_or_tip_of_reference(from) | 796 | .get_commit_or_tip_of_reference(from) |
| 797 | .unwrap() | 797 | .context(format!( |
| 798 | "cannot find commit from ref {from} to push to {to}" | ||
| 799 | ))? | ||
| 798 | .to_string(), | 800 | .to_string(), |
| 799 | ); | 801 | ); |
| 800 | new_state.insert( | 802 | new_state.insert( |
| 801 | to.to_string(), | 803 | to.to_string(), |
| 802 | git_repo | 804 | git_repo |
| 803 | .git_repo | 805 | .git_repo |
| 804 | .find_reference(to) | 806 | .find_reference(from) |
| 805 | .unwrap() | 807 | .context(format!("cannot find ref {from} to push to {to}"))? |
| 806 | .peel(git2::ObjectType::Tag) | 808 | .peel(git2::ObjectType::Tag) |
| 807 | .unwrap() | 809 | .context(format!("cannot find tag id {from} to push to {to}"))? |
| 808 | .id() | 810 | .id() |
| 809 | .to_string(), | 811 | .to_string(), |
| 810 | ); | 812 | ); |
| @@ -814,7 +816,9 @@ fn generate_updated_state( | |||
| 814 | to.to_string(), | 816 | to.to_string(), |
| 815 | git_repo | 817 | git_repo |
| 816 | .get_commit_or_tip_of_reference(from) | 818 | .get_commit_or_tip_of_reference(from) |
| 817 | .unwrap() | 819 | .context(format!( |
| 820 | "cannot find commit from ref {from} to push to {to}" | ||
| 821 | ))? | ||
| 818 | .to_string(), | 822 | .to_string(), |
| 819 | ); | 823 | ); |
| 820 | } | 824 | } |