()
| 11 | |
| 12 | #[test] |
| 13 | fn rebase_subcommand_simple() { |
| 14 | let repo_name = "rebase_subcommand_simple"; |
| 15 | let repo = setup_git_repo(repo_name); |
| 16 | let path_to_repo = generate_path_to_repo(repo_name); |
| 17 | |
| 18 | { |
| 19 | // create new file |
| 20 | create_new_file(&path_to_repo, "hello_world.txt", "Hello, world!"); |
| 21 | |
| 22 | // add first commit to master |
| 23 | first_commit_all(&repo, "first commit"); |
| 24 | }; |
| 25 | |
| 26 | assert_eq!(&get_current_branch_name(&repo), "master"); |
| 27 | |
| 28 | // create and checkout new branch named some_branch_1 |
| 29 | { |
| 30 | let branch_name = "some_branch_1"; |
| 31 | create_branch(&repo, branch_name); |
| 32 | checkout_branch(&repo, branch_name); |
| 33 | }; |
| 34 | |
| 35 | { |
| 36 | assert_eq!(&get_current_branch_name(&repo), "some_branch_1"); |
| 37 | |
| 38 | // create new file |
| 39 | create_new_file(&path_to_repo, "file_1.txt", "contents 1"); |
| 40 | |
| 41 | // add commit to branch some_branch_1 |
| 42 | commit_all(&repo, "message"); |
| 43 | }; |
| 44 | |
| 45 | // create and checkout new branch named some_branch_2 |
| 46 | { |
| 47 | let branch_name = "some_branch_2"; |
| 48 | create_branch(&repo, branch_name); |
| 49 | checkout_branch(&repo, branch_name); |
| 50 | }; |
| 51 | |
| 52 | { |
| 53 | assert_eq!(&get_current_branch_name(&repo), "some_branch_2"); |
| 54 | |
| 55 | // create new file |
| 56 | create_new_file(&path_to_repo, "file_2.txt", "contents 2"); |
| 57 | |
| 58 | // add commit to branch some_branch_2 |
| 59 | commit_all(&repo, "message"); |
| 60 | }; |
| 61 | |
| 62 | // create and checkout new branch named some_branch_3 |
| 63 | { |
| 64 | let branch_name = "some_branch_3"; |
| 65 | create_branch(&repo, branch_name); |
| 66 | checkout_branch(&repo, branch_name); |
| 67 | }; |
| 68 | |
| 69 | { |
| 70 | assert_eq!(&get_current_branch_name(&repo), "some_branch_3"); |
nothing calls this directly
no test coverage detected