From 8af57c2e9ef0b7ea29ca19f035e28e65b657191e Mon Sep 17 00:00:00 2001 From: lelgenio Date: Thu, 2 Mar 2023 17:53:18 -0300 Subject: [PATCH] fish: Fix prompt on repos with no commits --- user/fish/fish_prompt.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user/fish/fish_prompt.fish b/user/fish/fish_prompt.fish index 9647ea3..43df619 100644 --- a/user/fish/fish_prompt.fish +++ b/user/fish/fish_prompt.fish @@ -91,6 +91,9 @@ function fish_git_prompt _fish_prompt_warn "init" end + git rev-parse HEAD -- &>/dev/null + or return + # print a "↑" if ahead of origin if test 0 -ne (git log --oneline "$git_remote_branch"..HEAD -- | wc -l) or test 0 -ne "$git_log_unpushed"