(&self, branch_name: String)
| 223 | } |
| 224 | |
| 225 | pub fn remove_branch_from_chain(&self, branch_name: String) -> Result<(), Error> { |
| 226 | let results = Branch::get_branch_with_chain(self, &branch_name)?; |
| 227 | |
| 228 | match results { |
| 229 | BranchSearchResult::NotPartOfAnyChain => { |
| 230 | Branch::delete_all_configs(self, &branch_name)?; |
| 231 | |
| 232 | println!( |
| 233 | "Unable to remove branch from its chain: {}", |
| 234 | branch_name.bold() |
| 235 | ); |
| 236 | println!("It is not part of any chain. Nothing to do."); |
| 237 | } |
| 238 | BranchSearchResult::Branch(branch) => { |
| 239 | let chain_name = branch.chain_name.clone(); |
| 240 | let root_branch = branch.root_branch.clone(); |
| 241 | branch.remove_from_chain(self)?; |
| 242 | |
| 243 | println!( |
| 244 | "Removed branch {} from chain {}", |
| 245 | branch_name.bold(), |
| 246 | chain_name.bold() |
| 247 | ); |
| 248 | println!("Its root branch was: {}", root_branch.bold()); |
| 249 | } |
| 250 | }; |
| 251 | Ok(()) |
| 252 | } |
| 253 | |
| 254 | pub fn list_chains(&self, current_branch: &str, show_prs: bool) -> Result<(), Error> { |
| 255 | let list = Chain::get_all_chains(self)?; |
no test coverage detected