From 69516c87a611280e3c9bc4970e16b470381bb67f Mon Sep 17 00:00:00 2001 From: Claudio Mezzasalma Date: Tue, 22 Jan 2019 23:01:05 +0100 Subject: [PATCH] Only count stashes if variable is enabled --- fish_prompt.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 2ba2165..2063553 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -286,12 +286,12 @@ function __bobthefish_git_dirty_verbose -S -d 'Print a more verbose dirty state end function __bobthefish_git_stashed -S -d 'Print the stashed state for the current branch' - set -l stashes (command git rev-list --walk-reflogs --count refs/stash 2>/dev/null) + command git rev-parse --verify --quiet refs/stash >/dev/null or return echo -n "$git_stashed_glyph" if [ "$theme_display_git_stashed_verbose" = 'yes' ] - echo -n $stashes + echo -n (command git rev-list --walk-reflogs --count refs/stash 2>/dev/null) end end