ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: borrow RepoLoader from Workspace

It should be slightly cheaper than constructing new RepoLoader.
This commit is contained in:
Yuya Nishihara 2024-09-15 20:06:50 +09:00
parent 9dc2cf802c
commit cb07e5ab67
2 changed files with 2 additions and 4 deletions

View file

@ -84,8 +84,7 @@ pub fn cmd_op_diff(
) -> Result<(), CommandError> {
let workspace_command = command.workspace_helper(ui)?;
let workspace_env = workspace_command.env();
let repo = workspace_command.repo();
let repo_loader = &repo.loader();
let repo_loader = workspace_command.workspace().repo_loader();
let from_op;
let to_op;
if args.from.is_some() || args.to.is_some() {

View file

@ -53,8 +53,7 @@ pub fn cmd_op_show(
) -> Result<(), CommandError> {
let workspace_command = command.workspace_helper(ui)?;
let workspace_env = workspace_command.env();
let repo = workspace_command.repo();
let repo_loader = &repo.loader();
let repo_loader = workspace_command.workspace().repo_loader();
let op = workspace_command.resolve_single_op(&args.operation)?;
let parents: Vec<_> = op.parents().try_collect()?;
let parent_op = repo_loader.merge_operations(command.settings(), parents, None)?;