Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions asyncgit/src/sync/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,23 @@ pub fn get_status(

let repo: gix::Repository = gix_repo(repo_path)?;

let mut status = repo.status(gix::progress::Discard)?;
let show_untracked = if let Some(config) = show_untracked {
config
} else {
let git2_repo = crate::sync::repository::repo(repo_path)?;

// Calling `untracked_files_config_repo` ensures compatibility with `gitui` <= 0.27.
// `untracked_files_config_repo` defaults to `All` while both `libgit2` and `gix` default to
// `Normal`. According to [show-untracked-files], `normal` is the default value that `git`
// chooses.
//
// [show-untracked-files]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-statusshowUntrackedFiles
untracked_files_config_repo(&git2_repo)?
};

if let Some(config) = show_untracked {
status = status.untracked_files(config.into());
}
let status = repo
.status(gix::progress::Discard)?
.untracked_files(show_untracked.into());

let mut res = Vec::new();

Expand Down
Loading