sample_prompts/acidhub: Use the same branch logic as fish_git_prompt

This was broken for 4.0 because it used `{}` command grouping.

Instead just do one of the things the fish_git_prompt does.

(the default isn't usable here because it gets the sha from elsewhere)
This commit is contained in:
Fabian Boehm
2025-03-02 12:26:57 +01:00
parent 200eeffeee
commit e925eccad2

View File

@@ -7,8 +7,10 @@ function fish_prompt -d "Write out the prompt"
set -l git_info
if git rev-parse 2>/dev/null
set -l git_branch (
{ command git symbolic-ref HEAD 2>/dev/null || echo - } |
string replace refs/heads/ '')
command git symbolic-ref HEAD 2>/dev/null | string replace 'refs/heads/' ''
or command git describe HEAD 2>/dev/null
or echo unknown
)
set git_branch (set_color -o blue)"$git_branch"
set -l git_status
if git rev-parse --quiet --verify HEAD >/dev/null