Properly handle branches/tags with slashes in name

Fixes #13389