mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user