6934: Merge branch 'master' into 6934-pam
authorTom Clegg <tom@curoverse.com>
Wed, 12 Aug 2015 17:57:06 +0000 (13:57 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 12 Aug 2015 17:57:06 +0000 (13:57 -0400)
jenkins/run-build-packages.sh

index 9dcfd1f96bdd05c54131c7a18420a6be523994de..ad1494bfb6ce84c7505fa31e8a3027ec14b1f6f8 100755 (executable)
@@ -448,19 +448,22 @@ if [[ ! -d "$WORKSPACE/src-build-dir" ]]; then
   fi
 fi
 
+# Get the commit hash we're building against, from the working directory
+cd "$WORKSPACE"
+MASTER_COMMIT_HASH=$(format_last_commit_here "%H")
+
+# Make sure we check out that commit in the clean $WORKSPACE/src-build-dir directory
 cd "$WORKSPACE/src-build-dir"
 # just in case, check out master
 if [[ "$DEBUG" != 0 ]]; then
   git checkout master
   git pull
   # go into detached-head state
-  MASTER_COMMIT_HASH=$(format_last_commit_here "%H")
   git checkout "$MASTER_COMMIT_HASH"
 else
   git checkout -q master
   git pull -q
   # go into detached-head state
-  MASTER_COMMIT_HASH=$(format_last_commit_here "%H")
   git checkout -q "$MASTER_COMMIT_HASH"
 fi
 echo "$MASTER_COMMIT_HASH" >git-commit.version