From 964e5394aae537e603ae17ca5616cc2e77e7c86d Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Wed, 15 Feb 2017 16:58:08 +0100
Subject: [PATCH] The checkout scripts now perform an explicit `git pull` in
 case the user asked for a branch to be checked out. To properly update to the
 latest version of the repository, in case it was updated.

Former-commit-id: f2596d8f9a17863c7714bdb76a21fa2e1e76000f
---
 Build/AtlasBuildScripts/checkout_Gaudi.sh          | 5 +++++
 Build/AtlasBuildScripts/checkout_atlasexternals.sh | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/Build/AtlasBuildScripts/checkout_Gaudi.sh b/Build/AtlasBuildScripts/checkout_Gaudi.sh
index fcadbd9ddd1..e3594529d3f 100755
--- a/Build/AtlasBuildScripts/checkout_Gaudi.sh
+++ b/Build/AtlasBuildScripts/checkout_Gaudi.sh
@@ -75,6 +75,11 @@ cd ${SOURCEDIR}
 git fetch origin
 git checkout ${TAGBRANCH}
 
+# If this is a branch, fast forward to the latest version of it:
+if git show-ref -q --verify "refs/heads/${TAGBRANCH}" 2>/dev/null; then
+    git pull
+fi
+
 # If an output file was not specified, stop here:
 if [ "$HASHFILE" = "" ]; then
     exit 0
diff --git a/Build/AtlasBuildScripts/checkout_atlasexternals.sh b/Build/AtlasBuildScripts/checkout_atlasexternals.sh
index 219215043db..a15df685566 100755
--- a/Build/AtlasBuildScripts/checkout_atlasexternals.sh
+++ b/Build/AtlasBuildScripts/checkout_atlasexternals.sh
@@ -79,6 +79,11 @@ cd ${SOURCEDIR}
 git fetch origin
 git checkout ${TAGBRANCH}
 
+# If this is a branch, fast forward to the latest version of it:
+if git show-ref -q --verify "refs/heads/${TAGBRANCH}" 2>/dev/null; then
+    git pull
+fi
+
 # If an output file was not specified, stop here:
 if [ "$HASHFILE" = "" ]; then
     exit 0
-- 
GitLab