-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
rebase -r
of a parent of a merge commit
Previously, using `rebase -r` on the parent of a merge commit turned it into a non-merge commit. In other words, starting with ``` o d |\ o | c o | b | o a |/ o ``` and doing `rebase -r c -d a` resulted in ``` o d o b | o c | o a |/ o ``` where `d` is no longer a merge commit. For reference, here's a complete test that passed before this commit (but should NOT pass; see the diff for a test that should pass): ``` #[test] fn test_rebase_single_revision_merge_parent() { let test_env = TestEnvironment::default(); test_env.jj_cmd_success(test_env.env_root(), &["init", "repo", "--git"]); let repo_path = test_env.env_root().join("repo"); create_commit(&test_env, &repo_path, "a", &[]); create_commit(&test_env, &repo_path, "b", &[]); create_commit(&test_env, &repo_path, "c", &["b"]); create_commit(&test_env, &repo_path, "d", &["a", "c"]); // Test the setup insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" @ o d |\ o | c o | b | o a |/ o "###); let stdout = test_env.jj_cmd_success(&repo_path, &["rebase", "-r", "c", "-d", "a"]); insta::assert_snapshot!(stdout, @r###" Also rebased 2 descendant commits onto parent of rebased commit Working copy now at: 3e176b54d680 (no description set) Added 0 files, modified 0 files, removed 2 files "###); insta::assert_snapshot!(get_log_output(&test_env, &repo_path), @r###" @ o d | o c o | b | o a |/ o "###); } ```
- Loading branch information
Showing
2 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters