use cd -q to prevent hooks from firing

This commit is contained in:
Mathias Fredriksson
2015-05-27 19:30:12 +03:00
parent e46c59ff45
commit d766c8b8d9

View File

@@ -148,13 +148,15 @@ prompt_pure_async_git_dirty() {
local umode="-unormal"
[[ "$untracked_dirty" == "0" ]] && umode="-uno"
cd "$*"
# use cd -q to avoid side effects of changing directory, e.g. chpwd hooks
cd -q "$*"
command test -n "$(git status --porcelain --ignore-submodules ${umode})" &>/dev/null
(($? == 0)) && echo "*"
}
prompt_pure_async_git_fetch() {
cd "$*"
# use cd -q to avoid side effects of changing directory, e.g. chpwd hooks
cd -q "$*"
# set GIT_TERMINAL_PROMPT=0 to disable auth prompting for git fetch (git 2.3+)
GIT_TERMINAL_PROMPT=0 command git -c gc.auto=0 fetch