Hello,
We have a quirky situation we're trying to track down ... on random occasions, the environment variable value for "GIT_COMMIT" is actually set to the hash for the last commit instead of the current one, as the docs outline (
https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin).
The actual check out and console output shows the correct value of the hash, and also shows the value of the last checkout for "git rev-list" to be able to get the changelog... However, viewing Environment Variables (via /injectedEnvVars/ on the build) ... the value for GIT_COMMIT is the last hash ... which screws up some downstream jobs.
I'm still tracing the circumstances/stacktrace where this happens, but wondering if anyone else has hit this, or knows the reason for EnvVars to use last revision.... if not, I sense a ticket coming, to add to the queue of almost 300.
Cheers.