From 4bb50bb3fba1b86decf62d1f8763d56e34ac902c Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Sun, 14 May 2017 14:32:59 +0200 Subject: [PATCH] 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. --- hg-fast-export.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hg-fast-export.py b/hg-fast-export.py index 6a184c1..a49bec2 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -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 -- 2.11.4.GIT