title: Triggering Jenkins pipeline on any branch in bitbucket that had code pushed to it
body: <p>I have two repos (not my choice) for a project. The structure looks like this:</p>
  
  <pre><code>repo1
   |_folder
   |_tests
   |_src (repo2)
      |_index.html
      |_.git
  
   |_composer.json
   |_.git 
  </code></pre>
  
  <p>I set up a Jenkins pipeline that will clone <code>repo1</code>, then clone <code>repo2</code> under <code>src/</code>, and finally will run <code>composer install</code> under <code>repo1</code>. The pipeline script for the <code>src</code> repo looks like this:</p>
  
  <pre><code>checkout([
          $class: 'GitSCM', 
          branches: [[name: '**']], 
          doGenerateSubmoduleConfigurations: false, 
          extensions: [[$class: 'RelativeTargetDirectory', 
          relativeTargetDir: 'src']], 
          submoduleCfg: [], 
          userRemoteConfigs: [[
              credentialsId: 'XXXX-XXXX-XXXX', 
              url: 'https://BITBUCKETURL'
          ]]
      ])
  </code></pre>
  
  <p>I also have under "Build Triggers" the checkbox "Build when a change is pushed to Bitbucket" (using the bitbucket plugin). On top of that I have set up my webhook to send a request to jenkins. It should be noted that my webhook works for a freestyle project limited to a specific branch.</p>
  
  <p>What I want to be able to do now, is only test the branch that was pushed to, instead of every branch on trigger. Also, we don't have a naming convention for branches, so they can be named anything that isn't <code>master</code>. How should I handle this?</p>