diff options
author | Francisco Lopes <francisco@oblita.com> | 2019-08-31 01:30:26 -0300 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-09-02 20:27:04 -0400 |
commit | 722a0652fd3a3c0a1cb9fb3133f4304d8df672d0 (patch) | |
tree | 4d2e3eb503bc35d65534db967bc888219ad7585b | |
parent | 59e8b1fc927eff4874ea44e381953b86ffc8af7b (diff) |
feat: Respect status.showUntrackedFiles
-rw-r--r-- | src/modules/git_status.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/git_status.rs b/src/modules/git_status.rs index 693b938a9..2a637957e 100644 --- a/src/modules/git_status.rs +++ b/src/modules/git_status.rs @@ -119,7 +119,10 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { fn get_repo_status(repository: &Repository) -> Result<Status, git2::Error> { let mut status_options = git2::StatusOptions::new(); - status_options.include_untracked(true); + match repository.config()?.get_entry("status.showUntrackedFiles") { + Ok(entry) => status_options.include_untracked(entry.value() != Some("no")), + _ => status_options.include_untracked(true), + }; status_options.renames_from_rewrites(true); status_options.renames_head_to_index(true); status_options.renames_index_to_workdir(true); |