do not allow pull on local-only branch (#1067)

This commit is contained in:
Stephan Dilly 2022-01-09 16:31:20 +01:00 committed by GitHub
parent 1fd81b463e
commit b6429bc330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -572,12 +572,10 @@ impl Status {
}
fn pull(&self) {
if self.has_remotes() {
if let Some(branch) = self.git_branch_name.last() {
self.queue.push(InternalEvent::Pull(branch));
}
}
}
fn undo_last_commit(&self) {
try_or_popup!(
@ -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)