Applied rule #7 of git-check-ref-format

Rule #7 of git-check-ref-format states "7. They cannot end with a dot
'.'." which was not yet implemented in fast-export. This commit fixes
this.
This commit is contained in:
Anton Rieder
2012-05-16 23:44:00 +02:00
parent b2f6d28722
commit 8f6adfd07c

View File

@@ -140,7 +140,7 @@ def sanitize_name(name,what="branch"):
n=name
p=re.compile('([[ ~^:?*]|\.\.)')
n=p.sub('_', n)
if n[-1] == '/': n=n[:-1]+'_'
if n[-1] in ('/', '.'): n=n[:-1]+'_'
n='/'.join(map(dot,n.split('/')))
p=re.compile('_+')
n=p.sub('_', n)