From 887419589a1b05807936f0118100a0f8079bec07 Mon Sep 17 00:00:00 2001 From: lowne Date: Sat, 31 Jul 2021 17:50:19 +0200 Subject: [PATCH] make git prompt blue when clean repo with untracked files --- functions/fish_prompt.fish | 3 +++ functions/git_has_untracked.fish | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 functions/git_has_untracked.fish diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 669a01f..9a3ca7c 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -64,6 +64,9 @@ function fish_prompt else if git_is_touched set git_color white red + + else if git_has_untracked + set git_color white blue end if git_is_detached_head diff --git a/functions/git_has_untracked.fish b/functions/git_has_untracked.fish new file mode 100644 index 0000000..6c4a2bf --- /dev/null +++ b/functions/git_has_untracked.fish @@ -0,0 +1,3 @@ +function git_has_untracked -d "Test if there are any untracked files in the working tree" + test "0" != (git_untracked_files) +end