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

Function prune_subcommand_squashed_merged_branch

tests/prune.rs:11–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10#[test]
11fn 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",

Callers

nothing calls this directly

Calls 11

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_git_commandFunction · 0.85
run_test_bin_for_rebaseFunction · 0.85
teardown_git_repoFunction · 0.85

Tested by

no test coverage detected