From 722a0652fd3a3c0a1cb9fb3133f4304d8df672d0 Mon Sep 17 00:00:00 2001 From: Francisco Lopes Date: Sat, 31 Aug 2019 01:30:26 -0300 Subject: [PATCH] feat: Respect status.showUntrackedFiles --- src/modules/git_status.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/git_status.rs b/src/modules/git_status.rs index 693b938a..2a637957 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> { fn get_repo_status(repository: &Repository) -> Result { 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);