From 12b829e0bfa0b57a155058cdb59e203f9c1f5db4 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 1 Dec 2020 22:49:10 -0800 Subject: [PATCH] Fix "HEAD is not a symbolic ref" error when HEAD is a tag. --- fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 3016922..e0a653e 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -78,7 +78,7 @@ function __bobthefish_escape_regex -a str -d 'A backwards-compatible `string esc end function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' - set -l branch (command git symbolic-ref HEAD | string replace -r '^refs/heads/' '' 2>/dev/null) + set -l branch (command git symbolic-ref HEAD 2>/dev/null | string replace -r '^refs/heads/' '') and begin [ -n "$theme_git_default_branches" ] or set -l theme_git_default_branches master main