mirror of
https://github.com/frej/fast-export.git
synced 2025-11-01 17:05:46 +01:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user