Tidy up the branch string we get from using the %d placeholder
(cherry picked from commit 914e94b6c028cb312232350119777a41601edb00)