diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-18 22:00:35 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-18 22:00:35 +0000 |
| commit | 56b3c149df70af5d441e8527ec1225e5038bde8e (patch) | |
| tree | a73be853773a342158cb8032571502afdf369374 /src/lib/git_events.rs | |
| parent | 09db17fd719ddd42c5afad24e1a8e71735374f8e (diff) | |
fix: remove outdated patch_supports gate and fix fetch parent fallback
Remove the patch_supports_commit_ids gates in checkout.rs and list.rs
that pre-dated the mbox fallback logic. apply_patch_chain already
handles all fallback cases. Also replace the main-branch TODO fallback
in make_commits_for_proposal with get_parent_commit_from_patch, which
uses timestamp-based best-guess when the parent-commit tag is absent.
Diffstat (limited to 'src/lib/git_events.rs')
| -rw-r--r-- | src/lib/git_events.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/git_events.rs b/src/lib/git_events.rs index b39e797..32c23ac 100644 --- a/src/lib/git_events.rs +++ b/src/lib/git_events.rs | |||
| @@ -40,17 +40,16 @@ pub fn get_commit_id_from_patch(event: &Event) -> Result<String> { | |||
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | pub fn get_parent_commit_from_patch( | 43 | pub fn get_parent_commit_from_patch(event: &Event, git_repo: Option<&Repo>) -> Result<String> { |
| 44 | event: &Event, | ||
| 45 | git_repo: Option<&Repo>, | ||
| 46 | ) -> Result<String> { | ||
| 47 | if let Ok(parent) = tag_value(event, "parent-commit") { | 44 | if let Ok(parent) = tag_value(event, "parent-commit") { |
| 48 | return Ok(parent); | 45 | return Ok(parent); |
| 49 | } | 46 | } |
| 50 | 47 | ||
| 51 | let metadata = crate::mbox_parser::parse_mbox_patch(&event.content) | 48 | let metadata = crate::mbox_parser::parse_mbox_patch(&event.content) |
| 52 | .context("failed to parse patch for timestamp")?; | 49 | .context("failed to parse patch for timestamp")?; |
| 53 | let timestamp = metadata.committer_timestamp.unwrap_or(metadata.author_timestamp); | 50 | let timestamp = metadata |
| 51 | .committer_timestamp | ||
| 52 | .unwrap_or(metadata.author_timestamp); | ||
| 54 | 53 | ||
| 55 | if let Some(repo) = git_repo { | 54 | if let Some(repo) = git_repo { |
| 56 | if let Some(best_guess) = repo | 55 | if let Some(best_guess) = repo |