diff --git a/src/tabs/stashing.rs b/src/tabs/stashing.rs index 7afe6ae3f5..d32cbe3783 100644 --- a/src/tabs/stashing.rs +++ b/src/tabs/stashing.rs @@ -13,7 +13,10 @@ use crate::{ }; use anyhow::Result; use asyncgit::{ - sync::{self, status::StatusType, RepoPathRef}, + sync::{ + self, status::StatusType, RepoPathRef, + ShowUntrackedFilesConfig, + }, AsyncGitNotification, AsyncStatus, StatusParams, }; use crossterm::event::Event; @@ -71,9 +74,20 @@ impl Stashing { /// pub fn update(&mut self) -> Result<()> { if self.is_visible() { - self.git_status - //TODO: support options - .fetch(&StatusParams::new(StatusType::Both, None))?; + let status_type = if self.options.keep_index { + StatusType::Both + } else { + StatusType::WorkingDir + }; + let show_untracked = if self.options.stash_untracked { + Some(ShowUntrackedFilesConfig::All) + } else { + Some(ShowUntrackedFilesConfig::No) + }; + self.git_status.fetch(&StatusParams::new( + status_type, + show_untracked, + ))?; } Ok(())