diff options
Diffstat (limited to 'src/lib/git/mod.rs')
| -rw-r--r-- | src/lib/git/mod.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs index f9ce043..641349c 100644 --- a/src/lib/git/mod.rs +++ b/src/lib/git/mod.rs | |||
| @@ -773,13 +773,17 @@ impl RepoActions for Repo { | |||
| 773 | ) | 773 | ) |
| 774 | .context("failed to amend commit to produce new oid")?; | 774 | .context("failed to amend commit to produce new oid")?; |
| 775 | } | 775 | } |
| 776 | if !applied_oid.to_string().eq(commit_id) && pgp_sig.is_none() { | 776 | // If the OID still doesn't match after the amend, accept |
| 777 | bail!( | 777 | // the amend result and continue. The amend always produces |
| 778 | "when applied the patch commit id ({}) doesn't match the one specified in the event tag ({})", | 778 | // an unsigned commit (git_commit_amend goes through |
| 779 | applied_oid, | 779 | // git_commit__create_internal, not |
| 780 | get_commit_id_from_patch(patch)?, | 780 | // commit_create_with_signature) so any GPG sig |
| 781 | ); | 781 | // from the original is stripped — correct |
| 782 | } | 782 | // behaviour since the reconstructed commit object differs |
| 783 | // from what was originally signed. The diff is applied | ||
| 784 | // correctly regardless. apply_patch_chain threads the actual | ||
| 785 | // OID forward via next_parent_override so the chain remains | ||
| 786 | // consistent. | ||
| 783 | } | 787 | } |
| 784 | } | 788 | } |
| 785 | self.git_repo.set_index(&mut existing_index)?; | 789 | self.git_repo.set_index(&mut existing_index)?; |