From: David Kågedal Date: Thu, 3 Sep 2009 16:24:21 +0000 (+0200) Subject: Escape patch name when creating regexp X-Git-Tag: v0.15-rc3~3^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/ce4c86fa8d57eb809e291fb87613951414de2b71 Escape patch name when creating regexp Signed-off-by: David Kågedal Signed-off-by: Karl Wiberg --- diff --git a/stgit/commands/repair.py b/stgit/commands/repair.py index 37c4bab..5804a12 100644 --- a/stgit/commands/repair.py +++ b/stgit/commands/repair.py @@ -108,7 +108,7 @@ def read_commit_dag(branch): commits[id].children.add(commits[cs[0]]) for line in Run('git', 'show-ref').output_lines(): id, ref = line.split() - m = re.match(r'^refs/patches/%s/(.+)$' % branch, ref) + m = re.match(r'^refs/patches/%s/(.+)$' % re.escape(branch), ref) if m and not m.group(1).endswith('.log'): c = commits[id] c.patch = m.group(1)