mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-25 05:29:39 +00:00
commands: do not use debug print for path
"{:?}" escapes `\` to `\\` for Windows paths. That breaks tests checking paths without using "{:?}". Use PathBuf::display() in both commands and tests to get consistent output. This fixes test_init_local, test_init_git_internal, and test_init_git_external on Windows.
This commit is contained in:
parent
eacab648b0
commit
2f93ebd42c
2 changed files with 9 additions and 3 deletions
|
@ -615,7 +615,11 @@ fn cmd_init(
|
|||
} else {
|
||||
repo = ReadonlyRepo::init_local(ui.settings(), wc_path);
|
||||
}
|
||||
writeln!(ui, "Initialized repo in {:?}", repo.working_copy_path());
|
||||
writeln!(
|
||||
ui,
|
||||
"Initialized repo in \"{}\"",
|
||||
repo.working_copy_path().display()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -51,10 +51,12 @@ fn test_init_git_external() {
|
|||
assert!(repo_path.join(".jj").is_dir());
|
||||
let store_file_contents = std::fs::read_to_string(repo_path.join(".jj").join("store")).unwrap();
|
||||
assert!(store_file_contents.starts_with("git: "));
|
||||
assert!(store_file_contents.ends_with("/git-repo"));
|
||||
assert!(store_file_contents
|
||||
.replace('\\', "/")
|
||||
.ends_with("/git-repo"));
|
||||
assert_eq!(
|
||||
output.stdout_string(),
|
||||
format!("Initialized repo in \"{}\"\n", repo_path.to_str().unwrap())
|
||||
format!("Initialized repo in \"{}\"\n", repo_path.display())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue