Build the refusal for a dirty turn whose Git transition was classified exact but whose recorded content would not be the commit's content. `None` when there is no exact managed commit or the content agrees.
(
repo_root: &Path,
options: &TurnRecordOptions<'_>,
git_transition: &Option<RecordedGitTransition>,
status: &RepositoryStatus,
untracked_paths: &[String],
)
| 1106 | /// exact but whose recorded content would not be the commit's content. |
| 1107 | /// `None` when there is no exact managed commit or the content agrees. |
| 1108 | fn inexact_managed_commit_refusal( |
| 1109 | repo_root: &Path, |
| 1110 | options: &TurnRecordOptions<'_>, |
| 1111 | git_transition: &Option<RecordedGitTransition>, |
| 1112 | status: &RepositoryStatus, |
| 1113 | untracked_paths: &[String], |
| 1114 | ) -> Option<InexactManagedCommit> { |
| 1115 | let transition = git_transition.as_ref()?; |
| 1116 | let commit = transition.exact_commit_oid.as_deref()?; |
| 1117 | let parent = options |
| 1118 | .session |
| 1119 | .boundary_start |
| 1120 | .as_ref() |
| 1121 | .and_then(|boundary| boundary.git.as_ref()) |
| 1122 | .and_then(|git| git.head_oid.as_deref())?; |
| 1123 | let reason = |
| 1124 | managed_commit_selection_mismatch(repo_root, parent, commit, status, untracked_paths)?; |
| 1125 | Some(managed_commit_refusal(options, transition, commit, &reason)) |
| 1126 | } |
| 1127 | |
| 1128 | /// Build the refusal for an exact managed commit with a path Atomic cannot |
| 1129 | /// start tracking (a file replaced by a directory of the same name, for |
no test coverage detected