jenkinsci/gerrit-trigger-plugin — pull request #48 by bartosh (2013-03-14 14:14:23+00:00)
Title: Set GERRIT_REFSPEC variable for ref-updated event

If Refstpec parameter is set to $GERRIT_REFSPEC in git plugin
configuration as suggested on the wiki[1] plugin catn't fetch the ref
from the repository for ref-updated events. It crashes with the following
message:
ERROR: Problem fetching from origin / origin - could be unavailable.
Continuing anyway hudson.plugins.git.GitException:
org.eclipse.jgit.api.errors.TransportException: Remote does not have $GERRIT_REFSPEC available for fetch.

This makes impossible to use ref-updated and any change-specific events
in the same Jenkins job.

This change fixes the issue by setting GERRIT_REFSPEC to the same value
as GERRIT_REFNAME

1. https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger#GerritTrigger-UsagewiththeGitPlugin

Signed-off-by: Ed Bartosh