Fixing expected GIT_BRANCH environment variable behaviour

See comments in https://github.com/jenkinsci/git-plugin/pull/225