Skip checking git remote if working tree is $HOME

This commit is contained in:
Zhong Jianxin
2014-09-30 20:14:47 +08:00
parent f762b5ffa1
commit d4400b7bd9

View File

@@ -78,6 +78,8 @@ prompt_pure_precmd() {
(( ${PURE_GIT_PULL:-1} )) && { (( ${PURE_GIT_PULL:-1} )) && {
# check if we're in a git repo # check if we're in a git repo
command git rev-parse --is-inside-work-tree &>/dev/null && command git rev-parse --is-inside-work-tree &>/dev/null &&
# make sure working tree is not $HOME
[[ "$(command git rev-parse --show-toplevel)" != "$HOME" ]] &&
# check check if there is anything to pull # check check if there is anything to pull
command git fetch &>/dev/null && command git fetch &>/dev/null &&
# check if there is an upstream configured for this branch # check if there is an upstream configured for this branch