CB-10B Git-transport bootstrap (RFC §7.3/§8.6): `git clone` the checkout, initialize Atomic with the checked-out branch's view, and run the shared binding-first anchoring. A verified binding restores the exact state; an unbound history is an explicit typed refusal naming the supported foreign-synthesis path — never a silent merge or a false exact label.
(&self, target_path: &Path)
| 349 | /// naming the supported foreign-synthesis path — never a silent merge or |
| 350 | /// a false exact label. |
| 351 | fn run_git_bootstrap(&self, target_path: &Path) -> CliResult<()> { |
| 352 | // The view name for the scaffold: the checked-out branch when Git is |
| 353 | // already present (`--into-existing`), else the remote HEAD branch — |
| 354 | // read from the cloned checkout after cloning. |
| 355 | if !self.into_existing { |
| 356 | println!( |
| 357 | "Cloning Git repository {} into {}...", |
| 358 | hint(&self.url), |
| 359 | style_view(target_path.display()) |
| 360 | ); |
| 361 | validate_target_path(target_path)?; |
| 362 | // `git clone` creates (and cleans up) the target itself: a failed |
| 363 | // clone must never leave a partially initialized directory behind. |
| 364 | crate::commands::git::bootstrap::git_clone(&self.url, target_path)?; |
| 365 | } else { |
| 366 | validate_existing_git_checkout(target_path)?; |
| 367 | } |
| 368 | let view_name = { |
| 369 | let git = git2::Repository::open(target_path).map_err(|error| CliError::GitError { |
| 370 | message: format!("cannot open the cloned Git checkout: {error}"), |
| 371 | })?; |
| 372 | git.head() |
| 373 | .ok() |
| 374 | .and_then(|head| head.shorthand().ok().map(str::to_owned)) |
| 375 | .unwrap_or_else(|| self.view.clone()) |
| 376 | }; |
| 377 | let outcome = crate::commands::git::bootstrap::clone_git_url( |
| 378 | target_path, |
| 379 | &view_name, |
| 380 | self.binding_key_file.as_deref(), |
| 381 | self.include_degraded_binding_reads, |
| 382 | )?; |
| 383 | match outcome { |
| 384 | crate::commands::git::bootstrap::BootstrapOutcome::Bound { |
| 385 | binding_id, |
| 386 | view, |
| 387 | provenance_trusted, |
| 388 | anchored, |
| 389 | } => { |
| 390 | print_success(&format!( |
| 391 | "Bootstrap complete: exact bound restoration of binding {binding_id} into view '{view}'{}", |
| 392 | anchored |
| 393 | .as_ref() |
| 394 | .map(|id| format!(" (anchored with binding {id})")) |
| 395 | .unwrap_or_default(), |
| 396 | )); |
| 397 | if provenance_trusted { |
| 398 | print_info("Binding provenance is trusted under the configured policy."); |
| 399 | } else { |
| 400 | print_warning( |
| 401 | "Binding provenance is UNTRUSTED (content was independently verified).", |
| 402 | ); |
| 403 | } |
| 404 | } |
| 405 | crate::commands::git::bootstrap::BootstrapOutcome::Unbound { head, reason } => { |
| 406 | return Err(CliError::GitError { |
| 407 | message: format!( |
| 408 | "Git bootstrap of {head} is unbound: {reason}\ |
no test coverage detected