Skip to content

Commit

Permalink
filter-repo: pass raw bytestring to regex compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Elijah Newren <[email protected]>
  • Loading branch information
newren committed Oct 9, 2022
1 parent b164ffc commit cbc6535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ class FastExportParser(object):
# Compile some regexes and cache those
self._mark_re = re.compile(br'mark :(\d+)\n$')
self._parent_regexes = {}
parent_regex_rules = (b' :(\d+)\n$', b' ([0-9a-f]{40})\n')
parent_regex_rules = (br' :(\d+)\n$', br' ([0-9a-f]{40})\n')
for parent_refname in (b'from', b'merge'):
ans = [re.compile(parent_refname+x) for x in parent_regex_rules]
self._parent_regexes[parent_refname] = ans
Expand Down

0 comments on commit cbc6535

Please sign in to comment.