title: jenkins BRANCH_NAME variable no longer working
body: <p>I have this jenkinsfile that I run on jenkins</p>
  
  <pre><code>node("MacMiniSlave") {
    try{
    withEnv(["PATH=${env.HOME}/.rbenv/versions/2.3.1/bin:${env.PATH}","http_proxy=http://proxy.singaporepower.com.sg","https_proxy=http://proxy.singaporepower.com.sg","LANG=en_US.UTF-8","LANGUAGE=en_US.UTF-8"]){
        sh "env"
        echo "My branch is: ${env.BRANCH_NAME}"
      }
      currentBuild.result='SUCCESS'
    }catch(Exception e){
      currentBuild.result="FAILURE"
      throw e
    }finally{
      step([$class: 'GitHubCommitNotifier', resultOnFailure:'FAILURE'])
    }
  }
  </code></pre>
  
  <p>but the output from this is <code>My branch is: null</code>. Why is it so?</p>