More robust method to find current branch. Because Jenkins checkouts a commit, not a branch.