MCPcopy Create free account
hub / github.com/dashed/git-chain / rebase_subcommand_step

Function rebase_subcommand_step

tests/rebase.rs:369–727  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367
368#[test]
369fn 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");

Callers

nothing calls this directly

Calls 10

setup_git_repoFunction · 0.85
generate_path_to_repoFunction · 0.85
create_new_fileFunction · 0.85
first_commit_allFunction · 0.85
create_branchFunction · 0.85
checkout_branchFunction · 0.85
commit_allFunction · 0.85
run_test_bin_expect_okFunction · 0.85
run_test_bin_for_rebaseFunction · 0.85
teardown_git_repoFunction · 0.85

Tested by

no test coverage detected