mirror of https://github.com/mitchell/dotfiles.git
Change the way git branch detected to support older versions
This commit is contained in:
parent
101014980d
commit
47d96cda20
|
@ -72,8 +72,8 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set branch_color yellow
|
set branch_color yellow
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l cur_branch (git branch --show-current)
|
set -l cur_branch (string sub -s 3 (string match -r '^\* .*$' (git branch)))
|
||||||
if test -z $cur_branch; set cur_branch 'detached'; end
|
if string match -q '(HEAD detached*' $cur_branch; set cur_branch 'detached'; end
|
||||||
|
|
||||||
set -l cur_branch_len (string length $cur_branch)
|
set -l cur_branch_len (string length $cur_branch)
|
||||||
if test $cur_branch_len -gt 21
|
if test $cur_branch_len -gt 21
|
||||||
|
|
Loading…
Reference in New Issue