mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-13 15:37:55 +00:00
cli: don't crash when .
is given as file pattern
This commit is contained in:
parent
a02b5af1e8
commit
e76dc5a425
1 changed files with 8 additions and 1 deletions
|
@ -611,7 +611,14 @@ fn matcher_from_values(
|
|||
// formats)
|
||||
let mut paths = HashSet::new();
|
||||
for value in values {
|
||||
paths.insert(ui.parse_file_path(wc_path, value)?);
|
||||
let repo_path = ui.parse_file_path(wc_path, value)?;
|
||||
// TODO: Remove this when we have support for directories
|
||||
if repo_path.is_root() {
|
||||
return Err(CommandError::UserError(
|
||||
"Directory patterns are not yet supported.".to_string(),
|
||||
));
|
||||
}
|
||||
paths.insert(repo_path);
|
||||
}
|
||||
Ok(Box::new(FilesMatcher::new(paths)))
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue