From b546900e8f8e05102924794aad558d76388cf1c7 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sun, 11 Apr 2021 18:08:12 +0200 Subject: [PATCH] Fix 623 head remote (#631) --- src/components/branchlist.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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(()) }