We have divergent versions of this script across repos. This particular version comes from 6334836@scope. We in particular want this version's changes to support branches with a '/' character in them.