I am using Branch Specifier option of Jenkins Git plugin (v2.0) to run build on specific branch, e.g. 1.4.
${GIT_BRANCH} in this case conta
I managed to do that with a couple steps:
Add Execute shell pre step with these:
git_branch_local=$(echo $GIT_BRANCH | sed -e "s|origin/||g")
echo GIT_BRANCH_LOCAL=$git_branch_local > build.properties
Add an Inject environment variables pre step for build.properties file
then you should have a GIT_BRANCH_LOCAL environment variable that doesn't have origin/