cat: slightly change warning message about non-file paths

I'm going to add a similar message for access denied. That will want
an error message printed at the end. For consistency, let's do the
same for non-file paths.
This commit is contained in:
Martin von Zweigbergk 2024-05-30 15:53:43 -07:00 committed by Martin von Zweigbergk
parent e0e123873b
commit fccba76e8b
2 changed files with 2 additions and 2 deletions

View file

@ -114,7 +114,7 @@ fn write_tree_entries<P: AsRef<RepoPath>>(
let ui_path = workspace_command.format_file_path(path.as_ref()); let ui_path = workspace_command.format_file_path(path.as_ref());
writeln!( writeln!(
ui.warning_default(), ui.warning_default(),
"Path exists but is not a file: {ui_path}" "Path '{ui_path}' exists but is not a file"
)?; )?;
} }
MaterializedTreeValue::Tree(_) => panic!("entries should not contain trees"), MaterializedTreeValue::Tree(_) => panic!("entries should not contain trees"),

View file

@ -118,6 +118,6 @@ fn test_cat_symlink() {
a a
"###); "###);
insta::assert_snapshot!(stderr, @r###" insta::assert_snapshot!(stderr, @r###"
Warning: Path exists but is not a file: symlink1 Warning: Path 'symlink1' exists but is not a file
"###); "###);
} }