Adds timeout to git fetch
This commit is contained in:
parent
74f71c984b
commit
89bff23c25
1 changed files with 2 additions and 1 deletions
3
zshrc
3
zshrc
|
@ -14,7 +14,8 @@ export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:~/bin
|
||||||
|
|
||||||
# Mise à jour automatique à partir du repo distant
|
# Mise à jour automatique à partir du repo distant
|
||||||
cd /home/$USER/rc
|
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)
|
git_st=$(command git status --porcelain -b 2> /dev/null)
|
||||||
if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then
|
if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then
|
||||||
echo"You have unpushed business in /home/$USER/rc"
|
echo"You have unpushed business in /home/$USER/rc"
|
||||||
|
|
Loading…
Reference in a new issue