mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-17 05:04:27 +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
@ -615,7 +615,11 @@ fn cmd_init(
|
|||||||
} else {
|
} else {
|
||||||
repo = ReadonlyRepo::init_local(ui.settings(), wc_path);
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,10 +51,12 @@ fn test_init_git_external() {
|
|||||||
assert!(repo_path.join(".jj").is_dir());
|
assert!(repo_path.join(".jj").is_dir());
|
||||||
let store_file_contents = std::fs::read_to_string(repo_path.join(".jj").join("store")).unwrap();
|
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.starts_with("git: "));
|
||||||
assert!(store_file_contents.ends_with("/git-repo"));
|
assert!(store_file_contents
|
||||||
|
.replace('\\', "/")
|
||||||
|
.ends_with("/git-repo"));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
output.stdout_string(),
|
output.stdout_string(),
|
||||||
format!("Initialized repo in \"{}\"\n", repo_path.to_str().unwrap())
|
format!("Initialized repo in \"{}\"\n", repo_path.display())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user