[zsh] Export $gitbranches array when switching git branches

This commit is contained in:
Eryn Wells 2019-03-19 09:53:08 -07:00 committed by Eryn Wells
parent a5ef37252a
commit e856c04bbf

3
zshrc
View file

@ -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_}
}