some cleanup

This commit is contained in:
Stephan Dilly 2021-04-26 11:55:40 +02:00
parent 3bc21767cb
commit 838258c933
3 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,7 @@ impl Revlog {
///
pub fn update(&mut self) -> Result<()> {
if self.visible {
if self.is_visible() {
let log_changed =
self.git_log.fetch()? == FetchStatus::Started;

View File

@ -72,7 +72,7 @@ impl Stashing {
///
pub fn update(&mut self) -> Result<()> {
if self.visible {
if self.is_visible() {
self.git_status.fetch(&StatusParams::new(
StatusType::Both,
self.options.stash_untracked,
@ -92,7 +92,7 @@ impl Stashing {
&mut self,
ev: AsyncNotification,
) -> Result<()> {
if self.visible {
if self.is_visible() {
if let AsyncNotification::Status = ev {
let status = self.git_status.last()?;
self.index.update(&status.items)?;

View File

@ -43,7 +43,7 @@ impl StashList {
///
pub fn update(&mut self) -> Result<()> {
if self.visible {
if self.is_visible() {
let stashes = sync::get_stashes(CWD)?;
let commits =
sync::get_commits_info(CWD, stashes.as_slice(), 100)?;
@ -187,7 +187,7 @@ impl Component for StashList {
&mut self,
ev: crossterm::event::Event,
) -> Result<EventState> {
if self.visible {
if self.is_visible() {
if self.list.event(ev)?.is_consumed() {
return Ok(EventState::Consumed);
}