From 89bff23c25a18daa07159b337926e44be1e517e3 Mon Sep 17 00:00:00 2001 From: lhark Date: Tue, 9 Jun 2015 11:41:02 +0200 Subject: [PATCH] Adds timeout to git fetch --- zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 43c7f84..11bbd87 100644 --- a/zshrc +++ b/zshrc @@ -14,7 +14,8 @@ export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:~/bin # Mise à jour automatique à partir du repo distant cd /home/$USER/rc -git fetch +# In case the network is down, don't lock the terminal +timeout 3 git fetch git_st=$(command git status --porcelain -b 2> /dev/null) if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then echo"You have unpushed business in /home/$USER/rc"