Phase 3: Finalization and verification.
(&self, stats: &ImportStats)
| 3739 | |
| 3740 | /// Phase 3: Finalization and verification. |
| 3741 | fn phase3_finalize(&self, stats: &ImportStats) -> CliResult<()> { |
| 3742 | // Verify counts |
| 3743 | let expected = stats.commits_parsed; |
| 3744 | let actual = stats.changes_written |
| 3745 | + stats.empty_commits |
| 3746 | + stats.merge_commits |
| 3747 | + stats.self_push_skipped |
| 3748 | + stats.squash_inserted |
| 3749 | + stats.squash_skipped; |
| 3750 | |
| 3751 | if actual != expected { |
| 3752 | return Err(CliError::GitError { |
| 3753 | message: format!( |
| 3754 | "Import verification failed: {} commits parsed but {} changes created", |
| 3755 | expected, actual |
| 3756 | ), |
| 3757 | }); |
| 3758 | } |
| 3759 | |
| 3760 | Ok(()) |
| 3761 | } |
| 3762 | } |
| 3763 | |
| 3764 | // ═══════════════════════════════════════════════════════════════════════════ |