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