Tweak exception handling

os.remove only generates OSError exceptions, so no need to check for
IOError exceptions.
Fix single-character variable names
Properly handle branches/tags with slashes in name
Merge pull request #13454 from terminalmage/issue13389

Properly handle branches/tags with slashes in name