use crate::common::TestEnvironment;
#[test]
fn test_init_local() {
let test_env = TestEnvironment::default();
let output = test_env.run_jj_in(".", ["debug", "init-simple", "repo"]);
insta::assert_snapshot!(output, @r#"
------- stderr -------
Initialized repo in "repo"
[EOF]
"#);
let workspace_root = test_env.env_root().join("repo");
let jj_path = workspace_root.join(".jj");
let repo_path = jj_path.join("repo");
let store_path = repo_path.join("store");
assert!(workspace_root.is_dir());
assert!(jj_path.is_dir());
assert!(jj_path.join("working_copy").is_dir());
assert!(repo_path.is_dir());
assert!(store_path.is_dir());
assert!(store_path.join("commits").is_dir());
assert!(store_path.join("trees").is_dir());
assert!(store_path.join("files").is_dir());
assert!(store_path.join("symlinks").is_dir());
assert!(store_path.join("conflicts").is_dir());
let output = test_env.run_jj_in(
".",
["debug", "init-simple", "--ignore-working-copy", "repo2"],
);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: --ignore-working-copy is not respected
[EOF]
[exit status: 2]
");
let output = test_env.run_jj_in(".", ["debug", "init-simple", "--at-op=@-", "repo3"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: --at-op is not respected
[EOF]
[exit status: 2]
");
}