Fix crash when a branch name starts with '/'

If a branch name starts with '/' it will be split into ['', ...] and
then mapped over with dot(), only dot() does not handle the empty
string. Teach dot() to handle the empty string.

This fixes the underlying problem in issue #91.
This commit is contained in:
Frej Drejhammar
2017-05-14 14:32:59 +02:00
parent fb05ce5b7b
commit 4bb50bb3fb

View File

@@ -158,6 +158,7 @@ def sanitize_name(name,what="branch", mapping={}):
# work to do manually, write a tool that does it for you.
def dot(name):
if not name: return name
if name[0] == '.': return '_'+name[1:]
return name