From 42faa46e80fac6f4721f95d6b444ba360a46bc8f Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 6 Nov 2016 18:08:05 +0100 Subject: [PATCH] Allow git packages to be built using local cache if no network is available --- satellites/functions/vcs/git.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/satellites/functions/vcs/git.sh b/satellites/functions/vcs/git.sh index 2031c43..246d62f 100644 --- a/satellites/functions/vcs/git.sh +++ b/satellites/functions/vcs/git.sh @@ -11,8 +11,9 @@ vcs_git() { else cd "$dir" - git fetch > /dev/null - git reset --hard FETCH_HEAD > /dev/null + if git fetch > /dev/null; then + git reset --hard FETCH_HEAD > /dev/null + fi local rev="$(git rev-parse @)" if [ "$rev" != "$(cat "${dir}_rev_$_satname" 2> /dev/null || true)" ]; then echo "$rev" > "${dir}_rev_$_satname"