summaryrefslogtreecommitdiffstats
path: root/src/tabs
diff options
context:
space:
mode:
authorStephan Dilly <dilly.stephan@gmail.com>2022-01-09 16:31:20 +0100
committerGitHub <noreply@github.com>2022-01-09 16:31:20 +0100
commitb6429bc3305f1a6d354e76497eb1eb079240c42e (patch)
tree0a1ffa4b7e855534fa638834404365371c3c7d5e /src/tabs
parent1fd81b463e4077312ead508c1aef6f54fe8fcc7b (diff)
do not allow pull on local-only branch (#1067)
Diffstat (limited to 'src/tabs')
-rw-r--r--src/tabs/status.rs9
1 files changed, 4 insertions, 5 deletions
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)