cli: inline WorkspaceCommandHelper::for_loaded_repo()

This commit is contained in:
Martin von Zweigbergk 2022-10-07 23:14:47 -07:00 committed by Martin von Zweigbergk
parent 5ab74ebd5f
commit 94a91d9864

View file

@ -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(())