Accessing SCM (Git) variables on a Jenkins Pipeline job
This question already has an answer here:
Git Variables in Jenkins Workflow plugin
One Solution collect form web for “Accessing SCM (Git) variables on a Jenkins Pipeline job”
Here is an example of how you can get GIT_COMMIT – https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/gitcommit/gitcommit.groovy
You can extend it to expose GIT_BRANCH as well. This script is from the workflow examples git repo managed by cloudbees. Maybe you can send a pull request if you add capability to retrieve GIT_BRANCH variable.