From 259a72c53b328ec1e4b34f85ec0e2511816cd219 Mon Sep 17 00:00:00 2001 From: Tom Vincent Date: Wed, 30 Oct 2013 01:10:05 +0000 Subject: [PATCH] Conditionalise git pull check Whilst a nice feature, firing off a `git fetch` (and so an SSH/http call) after *every* shell interaction is a bit heavy for my liking. This adds the ability to disable it (whilst keeping it enabled by default). --- pure.zsh | 2 +- readme.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pure.zsh b/pure.zsh index be29ca6..61d19d2 100644 --- a/pure.zsh +++ b/pure.zsh @@ -59,7 +59,7 @@ prompt_pure_precmd() { print -P $prompt_pure_preprompt # check async if there is anything to pull - { + [[ -z $PURE_GIT_PULL || $PURE_GIT_PULL == true ]] && { # check if we're in a git repo command git rev-parse --is-inside-work-tree &>/dev/null && # check check if there is anything to pull diff --git a/readme.md b/readme.md index 5e645ba..eea9a3d 100644 --- a/readme.md +++ b/readme.md @@ -54,6 +54,9 @@ prompt pure The max execution time of a process before its run time is shown when it exits. Defaults to `5` seconds. +### `PURE_GIT_PULL` + +Set `PURE_GIT_PULL=false` to prevent Pure from checking whether the current Git remote has been updated. ## Example