Skip to content

Commit 0c2a608

Browse files
committed
cli: jj absorb warns when fileset doesn't exist
1 parent 61abfcb commit 0c2a608

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cli/src/commands/absorb.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use tracing::instrument;
2222

2323
use crate::cli_util::CommandHelper;
2424
use crate::cli_util::RevisionArg;
25+
use crate::cli_util::print_unmatched_explicit_paths;
2526
use crate::cli_util::print_updated_commits;
2627
use crate::command_error::CommandError;
2728
use crate::complete;
@@ -81,12 +82,11 @@ pub(crate) fn cmd_absorb(
8182
.parse_union_revsets(ui, &args.into)?
8283
.resolve()?;
8384

84-
let matcher = workspace_command
85-
.parse_file_patterns(ui, &args.paths)?
86-
.to_matcher();
85+
let fileset_expression = workspace_command.parse_file_patterns(ui, &args.paths)?;
86+
let matcher = fileset_expression.to_matcher();
8787

8888
let repo = workspace_command.repo().as_ref();
89-
let source = AbsorbSource::from_commit(repo, source_commit)?;
89+
let source = AbsorbSource::from_commit(repo, source_commit.clone())?;
9090
let selected_trees = split_hunks_to_trees(repo, &source, &destinations, &matcher).block_on()?;
9191

9292
let path_converter = workspace_command.path_converter();
@@ -122,6 +122,13 @@ pub(crate) fn cmd_absorb(
122122
}
123123
}
124124

125+
print_unmatched_explicit_paths(
126+
ui,
127+
tx.base_workspace_helper(),
128+
&fileset_expression,
129+
[&source_commit.tree().unwrap()],
130+
)?;
131+
125132
tx.finish(
126133
ui,
127134
format!(

0 commit comments

Comments
 (0)