Extracted redundant "branch spec to branch name" code
Checking for refs/heads/ in branchSpec

https://github.com/jenkinsci/git-client-plugin/pull/120/files#r10310025
comment of "dnozay"
Merge pull request #120 from alexanderlink/test/namespace3/master

Fix proposal for getHeadRev bug when using branch namespaces
Merge remote-tracking branch 'origin/master' into master-work