From e856c04bbf65054faf75b04068fd3f75c6154091 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 19 Mar 2019 09:53:08 -0700 Subject: [PATCH] [zsh] Export $gitbranches array when switching git branches --- zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zshrc b/zshrc index 65c1f65..59f0cca 100644 --- a/zshrc +++ b/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_} }