You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sanitize name is failing if branch name has less than two symbols.
Also it filtering regexp doen't cover cases if branch name has ' = and some other symbols.
My version of this method looks like:
def sanitize_name(name,what="branch"):
"""Sanitize input roughly according to git-check-ref-format(1)"""
def dot(name):
if len(name) == 0:
return name
if name[0] == '.' and len(name) == 1:
return '_'
if name[0] == '.':
return '_'+name[1:]
return name
n=name
p=re.compile('([[ ~^:?\\\\*\)\(\=\,\'#]|\.\.)')
n=n.strip()
n=p.sub('_', n)
if n[-1] in ('/', '.'): n=n[:-1]+'_'
n='/'.join(map(dot,n.split('/')))
p=re.compile('_+')
n=p.sub('_', n)
if n!=name:
sys.stderr.write('Warning: sanitized %s [%s] to [%s]\n' % (what,name,n))
return n
The text was updated successfully, but these errors were encountered:
Sanitize name is failing if branch name has less than two symbols.
Also it converts it filtering regexp doen't cover cases if branch name
has ' = and some other symbols.
My version of this method looks like:
def sanitize_name(name,what="branch"):
As far as I can see, you have created three new issues for the same
problem. Please do not do that, just add further comments on the initial
report. I have closed issues 32 and 33 and kept this one as it provides
both an analysis and a proposed solution to the problem.
Could you provide your proposed change as a pull-request? It is much
easier to review that way.
Sanitize name is failing if branch name has less than two symbols.
Also it filtering regexp doen't cover cases if branch name has ' = and some other symbols.
My version of this method looks like:
The text was updated successfully, but these errors were encountered: