[zsh] Export $gitbranches array when switching git branches
This commit is contained in:
parent
a5ef37252a
commit
e856c04bbf
1 changed files with 3 additions and 0 deletions
3
zshrc
3
zshrc
|
@ -227,6 +227,9 @@ function configure_vcs_info #{{{
|
|||
# Export the current Git branch before every prompt.
|
||||
function export_gitbranch {
|
||||
vcs_info general
|
||||
if [[ "$gitbranches[1]" != "${vcs_info_msg_0_}" ]]; then
|
||||
export gitbranches=(${vcs_info_msg_0_} $gitbranches[1,4])
|
||||
fi
|
||||
export gitbranch=${vcs_info_msg_0_}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue