mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
cli: inline WorkspaceCommandHelper::for_loaded_repo()
This commit is contained in:
parent
5ab74ebd5f
commit
94a91d9864
1 changed files with 4 additions and 14 deletions
|
@ -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(())
|
||||
|
|
Loading…
Reference in a new issue