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

Function delete_local_branch

tests/common/mod.rs:180–187  ·  view source on GitHub ↗
(repo: &Repository, branch_name: &str)

Source from the content-addressed store, hash-verified

178
179#[allow(dead_code)]
180pub fn delete_local_branch(repo: &Repository, branch_name: &str) {
181 let mut some_branch = repo.find_branch(branch_name, BranchType::Local).unwrap();
182
183 // Should not be able to delete branch_name if it is the current working tree
184 assert!(!some_branch.is_head());
185
186 some_branch.delete().unwrap();
187}
188
189#[allow(dead_code)]
190pub fn get_current_branch_name(repo: &Repository) -> String {

Callers 1

Calls 1

deleteMethod · 0.80

Tested by 1