diff --git a/cli/src/commands/branch/forget.rs b/cli/src/commands/branch/forget.rs index 3baed1939..375109b7a 100644 --- a/cli/src/commands/branch/forget.rs +++ b/cli/src/commands/branch/forget.rs @@ -40,17 +40,6 @@ pub struct BranchForgetArgs { pub glob: Vec, } -fn find_forgettable_branches( - view: &View, - name_patterns: &[StringPattern], -) -> Result, CommandError> { - find_branches_with(name_patterns, |pattern| { - view.branches() - .filter(|(name, _)| pattern.matches(name)) - .map(|(name, _)| name.to_owned()) - }) -} - pub fn cmd_branch_forget( ui: &mut Ui, command: &CommandHelper, @@ -76,3 +65,14 @@ pub fn cmd_branch_forget( } Ok(()) } + +fn find_forgettable_branches( + view: &View, + name_patterns: &[StringPattern], +) -> Result, CommandError> { + find_branches_with(name_patterns, |pattern| { + view.branches() + .filter(|(name, _)| pattern.matches(name)) + .map(|(name, _)| name.to_owned()) + }) +} diff --git a/cli/src/commands/branch/mod.rs b/cli/src/commands/branch/mod.rs index fb7513939..505e668b4 100644 --- a/cli/src/commands/branch/mod.rs +++ b/cli/src/commands/branch/mod.rs @@ -69,13 +69,6 @@ pub enum BranchCommand { Untrack(BranchUntrackArgs), } -fn make_branch_term(branch_names: &[impl fmt::Display]) -> String { - match branch_names { - [branch_name] => format!("branch {}", branch_name), - branch_names => format!("branches {}", branch_names.iter().join(", ")), - } -} - pub fn cmd_branch( ui: &mut Ui, command: &CommandHelper, @@ -94,6 +87,13 @@ pub fn cmd_branch( } } +fn make_branch_term(branch_names: &[impl fmt::Display]) -> String { + match branch_names { + [branch_name] => format!("branch {}", branch_name), + branch_names => format!("branches {}", branch_names.iter().join(", ")), + } +} + fn find_local_branches( view: &View, name_patterns: &[StringPattern],