diff --git a/src/app.rs b/src/app.rs index c0d0db9efe..c47ed3bc11 100644 --- a/src/app.rs +++ b/src/app.rs @@ -385,7 +385,7 @@ impl App { self.compare_commits_popup.update_git(ev)?; self.push_popup.update_git(ev)?; self.push_tags_popup.update_git(ev)?; - self.pull_popup.update_git(ev)?; + self.pull_popup.update_git(ev); self.select_branch_popup.update_git(ev)?; } @@ -686,7 +686,11 @@ impl App { flags.insert(NeedsUpdate::ALL); } InternalEvent::Pull(branch) => { - self.pull_popup.fetch(branch)?; + if let Err(error) = self.pull_popup.fetch(branch) { + self.queue.push(InternalEvent::ShowErrorMsg( + error.to_string(), + )); + } flags.insert(NeedsUpdate::ALL); } InternalEvent::PushTags => { diff --git a/src/components/pull.rs b/src/components/pull.rs index 05b1b7a716..05d4c84fb2 100644 --- a/src/components/pull.rs +++ b/src/components/pull.rs @@ -110,17 +110,18 @@ impl PullComponent { } /// - pub fn update_git( - &mut self, - ev: AsyncGitNotification, - ) -> Result<()> { + pub fn update_git(&mut self, ev: AsyncGitNotification) { if self.is_visible() { if let AsyncGitNotification::Fetch = ev { - self.update()?; + if let Err(error) = self.update() { + self.pending = false; + self.hide(); + self.queue.push(InternalEvent::ShowErrorMsg( + format!("fetch failed:\n{}", error), + )); + } } } - - Ok(()) } /// @@ -135,11 +136,7 @@ impl PullComponent { if err.is_empty() { self.try_ff_merge()?; } else { - self.pending = false; - self.hide(); - self.queue.push(InternalEvent::ShowErrorMsg( - format!("fetch failed:\n{}", err), - )); + anyhow::bail!(err); } } }