From 960241b421d55b8401b59085dee6ea31d65fdb1c Mon Sep 17 00:00:00 2001 From: Darren Kidd Date: Mon, 19 Oct 2020 13:03:33 +1300 Subject: [PATCH] Fix Git branch-name bug --- fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 58f8dce..3d4f2f7 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -76,7 +76,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 | cut -d "/" -f3 2>/dev/null) + set -l branch (command git symbolic-ref HEAD | string replace -r '^refs/heads/' '' 2>/dev/null) and begin [ -n "$theme_git_default_branches" ] or set -l theme_git_default_branches master main