Write the version-2 verified checkpoint after re-observing HEAD and confirming the view state (RFC §7.2 step 6, §7.1 step 8). Detached HEADs are supported: the checkpoint records a `None` symref so recording on an ephemeral `git/ ` view stays aligned.
(
&self,
git: &GitRepository,
view: &str,
expected_state: &Merkle,
)
| 786 | /// HEADs are supported: the checkpoint records a `None` symref so |
| 787 | /// recording on an ephemeral `git/<oid>` view stays aligned. |
| 788 | pub(crate) fn write_verified_checkpoint( |
| 789 | &self, |
| 790 | git: &GitRepository, |
| 791 | view: &str, |
| 792 | expected_state: &Merkle, |
| 793 | ) -> Result<WorkspaceCheckpoint, RepositoryError> { |
| 794 | let checkpoint = self.derive_workspace_checkpoint(git, view, expected_state)?; |
| 795 | write_workspace_checkpoint(self.root(), &checkpoint)?; |
| 796 | Ok(checkpoint) |
| 797 | } |
| 798 | |
| 799 | /// Derive (without writing) the version-2 checkpoint for one verified |
| 800 | /// view state (R3: the completion operation's Checkpoint lease derives |