diff --git a/CHANGELOG.md b/CHANGELOG.md index c80568dc..544e31c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - allow reverting a commit from the commit log ([#927](https://github.com/extrawurst/gitui/issues/927)) +- disable pull cmd on local-only branches ([#1047](https://github.com/extrawurst/gitui/issues/1047)) ### Fixed - Keep commit message when pre-commit hook fails ([#1035](https://github.com/extrawurst/gitui/issues/1035)) diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 57520432..f2c941a3 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -572,10 +572,8 @@ impl Status { } fn pull(&self) { - if self.has_remotes() { - if let Some(branch) = self.git_branch_name.last() { - self.queue.push(InternalEvent::Pull(branch)); - } + if let Some(branch) = self.git_branch_name.last() { + self.queue.push(InternalEvent::Pull(branch)); } } @@ -606,7 +604,7 @@ impl Status { } fn can_pull(&self) -> bool { - self.has_remotes() + self.has_remotes() && self.git_branch_state.is_some() } fn can_abort_merge(&self) -> bool { @@ -875,6 +873,7 @@ impl Component for Status { Ok(EventState::Consumed) } else if k == self.key_config.keys.pull && !self.is_focus_on_diff() + && self.can_pull() { self.pull(); Ok(EventState::Consumed)