+ # psvar[5] == current action (merge, rebase, ...)
+ # psvar[6] == current branch
+ # psvar[7] == repository base directory
+ # psvar[8] == current subdir into repository
+ # psvar[9] == status (untracked, unstaged, staged)
+
+ local git_dir ref base_dir sub_dir action branch gitstat gitstatus
+
+
+ # If nothing has been invalidated
+ if [[ "${__ZSH_GIT_VARS_INVALID}" == "0" && "${__ZSH_GIT_STATUS_INVALID}" == "0" ]]; then
+
+ # reuse previous values
+ psvar[5]=${__ZSH_GIT_ACTION}
+ psvar[6]=${__ZSH_GIT_BRANCH}
+ psvar[7]=${__ZSH_GIT_BASEDIR}
+ psvar[8]=${__ZSH_GIT_SUBDIR}
+ psvar[9]=${__ZSH_GIT_STATUS}
+
+ return
+ fi
+
+ # If only status has been invalidated
+ if [[ "${__ZSH_GIT_VARS_INVALID}" == "0" && "${__ZSH_GIT_STATUS_INVALID}" == "1" ]]; then
+
+ # reuse previous values
+ psvar[5]=${__ZSH_GIT_ACTION}
+ psvar[6]=${__ZSH_GIT_BRANCH}
+ psvar[7]=${__ZSH_GIT_BASEDIR}
+ psvar[8]=${__ZSH_GIT_SUBDIR}