mirror of
https://github.com/extrawurst/gitui.git
synced 2024-12-27 02:53:50 +03:00
do not allow pull on local-only branch (#1067)
This commit is contained in:
parent
1fd81b463e
commit
b6429bc330
@ -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))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user