(
&self,
repo: &mut Repository,
git: &GitRepository,
ledger: &mut ClosureLedger,
parsed: &ParsedCommit,
verified: &VerifiedProspectiveEquivalence,
| 7000 | #[allow(clippy::too_many_arguments)] |
| 7001 | #[allow(clippy::too_many_arguments)] |
| 7002 | fn write_empty_commit_synthesized( |
| 7003 | &self, |
| 7004 | repo: &mut Repository, |
| 7005 | git: &GitRepository, |
| 7006 | ledger: &mut ClosureLedger, |
| 7007 | parsed: &ParsedCommit, |
| 7008 | verified: &VerifiedProspectiveEquivalence, |
| 7009 | prospective: &atomic_repository::ProjectTree, |
| 7010 | boundaries: &[&'static str], |
| 7011 | touched_only: bool, |
| 7012 | ) -> CliResult<ImportedCommitInfo> { |
| 7013 | let commit_start = Instant::now(); |
| 7014 | |
| 7015 | let mut header_builder = ChangeHeader::builder() |
| 7016 | .message(&parsed.metadata.message) |
| 7017 | .author(Author::new( |
| 7018 | &parsed.metadata.author_name, |
| 7019 | parsed.metadata.author_email.as_deref(), |
| 7020 | )) |
| 7021 | .timestamp(parsed.metadata.timestamp); |
| 7022 | if let Some(ref desc) = parsed.metadata.description { |
| 7023 | header_builder = header_builder.description(desc); |
| 7024 | } |
| 7025 | let header = header_builder.build(); |
| 7026 | |
| 7027 | // Hashed empty-commit facts: tagged commit/tree OIDs, ordered |
| 7028 | // parents, raw author/committer identities and times. |
| 7029 | let algorithm = git_algorithm_for_sha(&parsed.git_sha)?; |
| 7030 | let tree_oid = git_object_id(algorithm, parsed.tree_oid)?; |
| 7031 | let origin = GitSynthesisOrigin::with_derivation( |
| 7032 | git_object_id_for_sha(algorithm, &parsed.git_sha)?, |
| 7033 | tree_oid.clone(), |
| 7034 | parsed |
| 7035 | .parent_oids |
| 7036 | .iter() |
| 7037 | .map(|oid| git_object_id(algorithm, *oid)) |
| 7038 | .collect::<CliResult<Vec<_>>>()?, |
| 7039 | GitDerivation::EmptyCommit, |
| 7040 | ) |
| 7041 | .map_err(|e| CliError::Internal(e.into()))?; |
| 7042 | |
| 7043 | let empty_facts = EmptyCommitFacts { |
| 7044 | format: EMPTY_COMMIT_FACTS_FORMAT, |
| 7045 | tree: tagged_oid_hex(&tree_oid), |
| 7046 | tree_algorithm: git_algorithm_label(algorithm).to_string(), |
| 7047 | author: ForeignSignatureFacts { |
| 7048 | name: parsed.metadata.author_name.clone(), |
| 7049 | email: parsed.metadata.author_email.clone(), |
| 7050 | time: parsed.metadata.author_time, |
| 7051 | time_offset_seconds: parsed.metadata.author_time_offset_seconds, |
| 7052 | name_raw_hex: hex_bytes(Some(&parsed.metadata.author_name_raw)), |
| 7053 | email_raw_hex: hex_bytes(parsed.metadata.author_email_raw.as_deref()), |
| 7054 | }, |
| 7055 | committer: CommitterFacts { |
| 7056 | name: parsed.metadata.committer_name.clone(), |
| 7057 | email: parsed.metadata.committer_email.clone(), |
| 7058 | time: parsed.metadata.committer_time, |
| 7059 | time_offset_seconds: parsed.metadata.committer_time_offset_seconds, |
no test coverage detected