cli: inline `WorkspaceCommandHelper::for_loaded_repo()`
@@ -275,13 +275,15 @@ jj init --git-repo=.";
workspace: Workspace,
repo: Arc<ReadonlyRepo>,
) -> Result<WorkspaceCommandHelper, CommandError> {
- WorkspaceCommandHelper::for_loaded_repo(
+ let mut helper = WorkspaceCommandHelper::new(
ui,
workspace,
self.string_args.clone(),
&self.global_args,
repo,
- )
+ )?;
+ helper.snapshot(ui)?;
+ Ok(helper)
}
}
@@ -329,18 +331,6 @@ impl WorkspaceCommandHelper {
})
}
- pub fn for_loaded_repo(
- ui: &mut Ui,
- workspace: Workspace,
- string_args: Vec<String>,
- global_args: &GlobalArgs,
- repo: Arc<ReadonlyRepo>,
- ) -> Result<Self, CommandError> {
- let mut helper = Self::new(ui, workspace, string_args, global_args, repo)?;
- helper.snapshot(ui)?;
- Ok(helper)
- }
-
fn check_working_copy_writable(&self) -> Result<(), CommandError> {
if self.may_update_working_copy {
Ok(())
