MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / finish_service_switch

Function finish_service_switch

atomic-cli/src/commands/view/switch.rs:153–162  ·  view source on GitHub ↗

Finish the existing Git boundary after a successful service-owned native switch. The service has released its workspace lease and database handle.

(repo_root: &std::path::Path, view: &str)

Source from the content-addressed store, hash-verified

151/// Finish the existing Git boundary after a successful service-owned native
152/// switch. The service has released its workspace lease and database handle.
153pub(crate) fn finish_service_switch(repo_root: &std::path::Path, view: &str) -> CliResult<()> {
154 let repo = Repository::open_for_workspace_transaction_wait(
155 repo_root,
156 atomic_repository::database_lock_wait(),
157 )
158 .map_err(CliError::Repository)?;
159 let shadow_sync = crate::commands::git::shadow::sync_git_head_to_view(&repo, repo_root, view)?;
160 drop(repo);
161 checkpoint_shadow_switch(shadow_sync, repo_root, view)
162}
163
164impl Command for Switch {
165 fn run(&self) -> CliResult<()> {

Callers 3

view_switchFunction · 0.85
view_switch_plainFunction · 0.85

Calls 3

database_lock_waitFunction · 0.85
sync_git_head_to_viewFunction · 0.85
checkpoint_shadow_switchFunction · 0.85

Tested by

no test coverage detected