From 76a9cae54d7bc0b77a5f06e2c27c986336b54f80 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Wed, 6 May 2026 17:19:49 +0000 Subject: [PATCH] [F] Fix git status --- fish/includes/prompt.fish | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fish/includes/prompt.fish b/fish/includes/prompt.fish index 5d9351f..a90328e 100644 --- a/fish/includes/prompt.fish +++ b/fish/includes/prompt.fish @@ -66,14 +66,11 @@ function __fishrc_prompt_pr_state --description 'Set GitHub PR prompt state for set -g __fishrc_vcs_pr_color "$pr_color" end -function __fishrc_git_unpushed_count --description 'Print commits ahead of the git upstream or remotes' +function __fishrc_git_unpushed_count --description 'Print commits ahead of the git upstream' set -l upstream (command git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}' 2>/dev/null) - if test -n "$upstream" - command git rev-list --count "$upstream"..HEAD 2>/dev/null - return - end + test -n "$upstream"; or return 1 - command git rev-list --count HEAD --not --remotes 2>/dev/null + command git rev-list --count "$upstream"..HEAD 2>/dev/null end function __fishrc_git_prompt_state --description 'Set compact git repository state for the prompt'