ok/jj
1
0
Fork 0
forked from mirrors/jj

test_rebase_command: avoid an unnecessary special case

`jj new` can be used with 1 or more arguments to create non-merge
commits or merge commits.
This commit is contained in:
Martin von Zweigbergk 2022-11-04 18:46:45 -07:00 committed by Martin von Zweigbergk
parent d09a8f50df
commit 4399ef54c1

View file

@ -20,9 +20,7 @@ pub mod common;
fn create_commit(test_env: &TestEnvironment, repo_path: &Path, name: &str, parents: &[&str]) {
if parents.is_empty() {
test_env.jj_cmd_success(repo_path, &["co", "root"]);
} else if parents.len() == 1 {
test_env.jj_cmd_success(repo_path, &["co", parents[0]]);
test_env.jj_cmd_success(repo_path, &["new", "root"]);
} else {
let mut args = vec!["new", "-m", name];
args.extend(parents);