JENKINS-24554

Builds get triggered multiple times when the SCM. When building environment variables and/or comparing revision across builds, make sure to use the system environment variables from the build you are comparing to otherwise the comparison is unfair
Should rather document what this does, and why, rather than repeat the issue summary.