File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -177,11 +177,23 @@ pub fn get_status(
177177
178178 let repo: gix:: Repository = gix_repo ( repo_path) ?;
179179
180- let mut status = repo. status ( gix:: progress:: Discard ) ?;
180+ let show_untracked = if let Some ( config) = show_untracked {
181+ config
182+ } else {
183+ let git2_repo = crate :: sync:: repository:: repo ( repo_path) ?;
184+
185+ // Calling `untracked_files_config_repo` ensures compatibility with `gitui` <= 0.27.
186+ // `untracked_files_config_repo` defaults to `All` while both `libgit2` and `gix` default to
187+ // `Normal`. According to [show-untracked-files], `normal` is the default value that `git`
188+ // chooses.
189+ //
190+ // [show-untracked-files]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-statusshowUntrackedFiles
191+ untracked_files_config_repo ( & git2_repo) ?
192+ } ;
181193
182- if let Some ( config ) = show_untracked {
183- status = status . untracked_files ( config . into ( ) ) ;
184- }
194+ let status = repo
195+ . status ( gix :: progress :: Discard ) ?
196+ . untracked_files ( show_untracked . into ( ) ) ;
185197
186198 let mut res = Vec :: new ( ) ;
187199
You can’t perform that action at this time.
0 commit comments