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

Function rebase_subcommand_simple

tests/rebase.rs:13–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[test]
13fn 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");

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