mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
show git tags if any
Without change tags not shown (because return happen earlier). With change tags shown if exists.
This commit is contained in:
parent
626bd39b00
commit
3bd40175eb
@ -78,6 +78,9 @@ function __bobthefish_escape_regex -a str -d 'A backwards-compatible `string esc
|
|||||||
end
|
end
|
||||||
|
|
||||||
function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)'
|
function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)'
|
||||||
|
set -l tag (command git describe --tags --exact-match 2>/dev/null)
|
||||||
|
and echo "$tag_glyph $tag "
|
||||||
|
|
||||||
set -l branch (command git symbolic-ref HEAD 2>/dev/null | string replace -r '^refs/heads/' '')
|
set -l branch (command git symbolic-ref HEAD 2>/dev/null | string replace -r '^refs/heads/' '')
|
||||||
and begin
|
and begin
|
||||||
[ -n "$theme_git_default_branches" ]
|
[ -n "$theme_git_default_branches" ]
|
||||||
@ -97,10 +100,6 @@ function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish
|
|||||||
and return
|
and return
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l tag (command git describe --tags --exact-match 2>/dev/null)
|
|
||||||
and echo "$tag_glyph $tag"
|
|
||||||
and return
|
|
||||||
|
|
||||||
set -l branch (command git show-ref --head -s --abbrev | head -n1 2>/dev/null)
|
set -l branch (command git show-ref --head -s --abbrev | head -n1 2>/dev/null)
|
||||||
echo "$detached_glyph $branch"
|
echo "$detached_glyph $branch"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user