diff --git a/src/commands.rs b/src/commands.rs index f81d19c50..6c2dc8c15 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -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(()) } diff --git a/tests/test_init_command.rs b/tests/test_init_command.rs index b21d23e0a..ec77cd251 100644 --- a/tests/test_init_command.rs +++ b/tests/test_init_command.rs @@ -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()) ); }