diff --git a/src/components/branchlist.rs b/src/components/branchlist.rs index d60a42fe..372e27a4 100644 --- a/src/components/branchlist.rs +++ b/src/components/branchlist.rs @@ -273,6 +273,13 @@ impl BranchListComponent { /// fetch list of branches pub fn update_branches(&mut self) -> Result<()> { self.branches = get_branches_info(CWD, self.local)?; + //remove remote branch called `HEAD` + if !self.local { + self.branches + .iter() + .position(|b| b.name.ends_with("/HEAD")) + .map(|idx| self.branches.remove(idx)); + } self.set_selection(self.selection)?; Ok(()) }