From ce4c86fa8d57eb809e291fb87613951414de2b71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20K=C3=A5gedal?= Date: Thu, 3 Sep 2009 18:24:21 +0200 Subject: [PATCH] Escape patch name when creating regexp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: David KÃ¥gedal Signed-off-by: Karl Wiberg --- stgit/commands/repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.11.0