From 56d1b0b76cf5d0a8959d58ab0679e0b359a91b67 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mar 28 2019 20:19:49 +0000 Subject: replace recommended git commands with working ones git fetch && git reset --hard were recommended in #git because "git pull can cause trouble". So far for the theory. In practise, git fetch && git reset --hard didn't update to the latest HEAD, leading to a trouble-free outdated version ;-) Switch over to git pull - even if it's not recommended, it works better ;-) --- diff --git a/salt/profile/static/files/git_pull_and_update.sh b/salt/profile/static/files/git_pull_and_update.sh index 2d52ca1..46166c3 100644 --- a/salt/profile/static/files/git_pull_and_update.sh +++ b/salt/profile/static/files/git_pull_and_update.sh @@ -23,7 +23,7 @@ EXPECTED_SHA256="$(echo '{%- for file, sha256 in expected_gitmodules.items() %} # update all git repos, exit if one of them fails (better outdated than inconsistent) cd "$BASEDIR" || exit 1 for dir in $GIT_DIRS ; do - cd "$BASEDIR/$dir" && git fetch -q && git reset -q --hard || exit 1 + cd "$BASEDIR/$dir" && git pull -q || exit 1 done # check if any .gitmodules appeared or disappeared