Execute the pull command. This method creates a tokio runtime and executes the async pull operation. It handles all the steps required to download and apply remote changes. # Errors Returns an error if: - No repository is found - The remote cannot be connected to - Network operations fail - Changes fail to download or save
(&self)
| 1030 | /// - Network operations fail |
| 1031 | /// - Changes fail to download or save |
| 1032 | fn run(&self) -> CliResult<()> { |
| 1033 | // Route every form through the service layer: the handler performs |
| 1034 | // the network sync, the applies, and the verification; the CLI |
| 1035 | // renders the local pull body's lines from the report. |
| 1036 | if crate::commands::rpc::pull(self)? { |
| 1037 | return Ok(()); |
| 1038 | } |
| 1039 | |
| 1040 | let repo_root = find_repository_root()?; |
| 1041 | |
| 1042 | // A current-thread runtime keeps the workspace transaction's ordered |
| 1043 | // operation locks bound to one thread for the whole async body; nested |
| 1044 | // repository operations re-enter them instead of contending. |
| 1045 | let rt = tokio::runtime::Builder::new_current_thread() |
| 1046 | .enable_all() |
| 1047 | .build() |
| 1048 | .map_err(|e| { |
| 1049 | CliError::Internal(anyhow::anyhow!("Failed to create async runtime: {}", e)) |
| 1050 | })?; |
| 1051 | |
| 1052 | rt.block_on(self.run_async(repo_root)) |
| 1053 | } |
| 1054 | } |
| 1055 | |
| 1056 | // Tests |
nothing calls this directly
no test coverage detected