mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-25 05:29:39 +00:00
squash: add test that immutable commits are respected for --from/--into
This commit is contained in:
parent
9503179ea4
commit
492dd99ba5
1 changed files with 13 additions and 1 deletions
|
@ -247,12 +247,24 @@ fn test_rewrite_immutable_commands() {
|
|||
Error: Commit 406c181c04d8 is immutable
|
||||
Hint: Pass `--ignore-immutable` or configure the set of immutable commits via `revset-aliases.immutable_heads()`.
|
||||
"###);
|
||||
// squash
|
||||
// squash -r
|
||||
let stderr = test_env.jj_cmd_failure(&repo_path, &["squash", "-r=description(b)"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
Error: Commit c8d4c7ca95d0 is immutable
|
||||
Hint: Pass `--ignore-immutable` or configure the set of immutable commits via `revset-aliases.immutable_heads()`.
|
||||
"###);
|
||||
// squash --from
|
||||
let stderr = test_env.jj_cmd_failure(&repo_path, &["squash", "--from=main"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
Error: Commit 406c181c04d8 is immutable
|
||||
Hint: Pass `--ignore-immutable` or configure the set of immutable commits via `revset-aliases.immutable_heads()`.
|
||||
"###);
|
||||
// squash --into
|
||||
let stderr = test_env.jj_cmd_failure(&repo_path, &["squash", "--into=main"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
Error: Commit 406c181c04d8 is immutable
|
||||
Hint: Pass `--ignore-immutable` or configure the set of immutable commits via `revset-aliases.immutable_heads()`.
|
||||
"###);
|
||||
// unsquash
|
||||
let stderr = test_env.jj_cmd_failure(&repo_path, &["unsquash", "-r=main"]);
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
|
|
Loading…
Reference in a new issue