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
|
||||
end
|
||||
|
||||
set -l cur_branch (git branch --show-current)
|
||||
if test -z $cur_branch; set cur_branch 'detached'; end
|
||||
set -l cur_branch (string sub -s 3 (string match -r '^\* .*$' (git branch)))
|
||||
if string match -q '(HEAD detached*' $cur_branch; set cur_branch 'detached'; end
|
||||
|
||||
set -l cur_branch_len (string length $cur_branch)
|
||||
if test $cur_branch_len -gt 21
|
||||
|
|
Loading…
Reference in New Issue