title: Why is the Jenkins Git Plugin using old parameter values when being triggered by SCM tool
body: <p>We use a Jenkins build server to build our software after pushes to several Git repositories.</p>
  
  <p>Since we went to some code reorganization recently I tried to set up a more sophisticated build pipeline, building each of our products (a Git repository each) in the order of their dependencies.</p>
  
  <p>Each job triggers the execution of the subsequent project's build job passing the <code>$GIT_BRANCH</code> to the next job.</p>
  
  <p>The whole pipeline works pretty well, I start the build of the first project in <code>origin/master</code> and project 2, 3 and 4 get build in master. I start in another branch, the subsequent projects switch to this branch.</p>
  
  <p>I use the Git Parameter Plug-in to do the Branch-Selection and pass it to the Git branch refs. The default value is an empty string.</p>
  
  <p>Unfortunately this whole setup breaks the push hooks from Gitblit. While Jenkins still reports that the concrete project was triggered to check the SCM, builds only starts if the commit was in the branch selected for the last manual build.</p>
  
  <p>Checking the Git poll log I see that only the previously selected branch was checked for changes. </p>
  
  <p>From my still basic understanding of all of this I would guess, that the SCM poll trigger uses the last "known" value, not the defaultValue of the parameter. Is this a bug in Jenkins, the plugin or my configuration. Has anybody else accomplished such a dual-use pipeline?</p>
  
  <p><strong>edit</strong>: I tried "**" as default value, same outcome.</p>