()
| 367 | |
| 368 | #[test] |
| 369 | fn rebase_subcommand_step() { |
| 370 | let repo_name = "rebase_subcommand_step"; |
| 371 | let repo = setup_git_repo(repo_name); |
| 372 | let path_to_repo = generate_path_to_repo(repo_name); |
| 373 | |
| 374 | { |
| 375 | // create new file |
| 376 | create_new_file(&path_to_repo, "hello_world.txt", "Hello, world!"); |
| 377 | |
| 378 | // add first commit to master |
| 379 | first_commit_all(&repo, "first commit"); |
| 380 | }; |
| 381 | |
| 382 | assert_eq!(&get_current_branch_name(&repo), "master"); |
| 383 | |
| 384 | // create and checkout new branch named some_branch_1 |
| 385 | { |
| 386 | let branch_name = "some_branch_1"; |
| 387 | create_branch(&repo, branch_name); |
| 388 | checkout_branch(&repo, branch_name); |
| 389 | }; |
| 390 | |
| 391 | { |
| 392 | assert_eq!(&get_current_branch_name(&repo), "some_branch_1"); |
| 393 | |
| 394 | // create new file |
| 395 | create_new_file(&path_to_repo, "file_1.txt", "contents 1"); |
| 396 | |
| 397 | // add commit to branch some_branch_1 |
| 398 | commit_all(&repo, "message"); |
| 399 | }; |
| 400 | |
| 401 | // create and checkout new branch named some_branch_2 |
| 402 | { |
| 403 | let branch_name = "some_branch_2"; |
| 404 | create_branch(&repo, branch_name); |
| 405 | checkout_branch(&repo, branch_name); |
| 406 | }; |
| 407 | |
| 408 | { |
| 409 | assert_eq!(&get_current_branch_name(&repo), "some_branch_2"); |
| 410 | |
| 411 | // create new file |
| 412 | create_new_file(&path_to_repo, "file_2.txt", "contents 2"); |
| 413 | |
| 414 | // add commit to branch some_branch_2 |
| 415 | commit_all(&repo, "message"); |
| 416 | }; |
| 417 | |
| 418 | // create and checkout new branch named some_branch_3 |
| 419 | { |
| 420 | let branch_name = "some_branch_3"; |
| 421 | create_branch(&repo, branch_name); |
| 422 | checkout_branch(&repo, branch_name); |
| 423 | }; |
| 424 | |
| 425 | { |
| 426 | assert_eq!(&get_current_branch_name(&repo), "some_branch_3"); |
nothing calls this directly
no test coverage detected