Fix 623 head remote (#631)

This commit is contained in:
Stephan Dilly 2021-04-11 18:08:12 +02:00 committed by GitHub
parent 7bc3ee1dd3
commit b546900e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(())
}