forked from mirrors/jj
cli: borrow RepoLoader from Workspace
It should be slightly cheaper than constructing new RepoLoader.
This commit is contained in:
parent
9dc2cf802c
commit
cb07e5ab67
2 changed files with 2 additions and 4 deletions
|
@ -84,8 +84,7 @@ pub fn cmd_op_diff(
|
||||||
) -> Result<(), CommandError> {
|
) -> Result<(), CommandError> {
|
||||||
let workspace_command = command.workspace_helper(ui)?;
|
let workspace_command = command.workspace_helper(ui)?;
|
||||||
let workspace_env = workspace_command.env();
|
let workspace_env = workspace_command.env();
|
||||||
let repo = workspace_command.repo();
|
let repo_loader = workspace_command.workspace().repo_loader();
|
||||||
let repo_loader = &repo.loader();
|
|
||||||
let from_op;
|
let from_op;
|
||||||
let to_op;
|
let to_op;
|
||||||
if args.from.is_some() || args.to.is_some() {
|
if args.from.is_some() || args.to.is_some() {
|
||||||
|
|
|
@ -53,8 +53,7 @@ pub fn cmd_op_show(
|
||||||
) -> Result<(), CommandError> {
|
) -> Result<(), CommandError> {
|
||||||
let workspace_command = command.workspace_helper(ui)?;
|
let workspace_command = command.workspace_helper(ui)?;
|
||||||
let workspace_env = workspace_command.env();
|
let workspace_env = workspace_command.env();
|
||||||
let repo = workspace_command.repo();
|
let repo_loader = workspace_command.workspace().repo_loader();
|
||||||
let repo_loader = &repo.loader();
|
|
||||||
let op = workspace_command.resolve_single_op(&args.operation)?;
|
let op = workspace_command.resolve_single_op(&args.operation)?;
|
||||||
let parents: Vec<_> = op.parents().try_collect()?;
|
let parents: Vec<_> = op.parents().try_collect()?;
|
||||||
let parent_op = repo_loader.merge_operations(command.settings(), parents, None)?;
|
let parent_op = repo_loader.merge_operations(command.settings(), parents, None)?;
|
||||||
|
|
Loading…
Reference in a new issue