It's a waste of time to recompile the same regexp every time we go
through the loop.
Signed-off-by: Karl Hasselström <kha@treskal.com>
def get_heads():
heads = []
def get_heads():
heads = []
+ hr = re.compile(r'^[0-9a-f]{40} refs/heads/(.+)$')
for line in _output_lines(['git-show-ref', '--heads']):
for line in _output_lines(['git-show-ref', '--heads']):
- m = re.match('^[0-9a-f]{40} refs/heads/(.+)$', line)
heads.append(m.group(1))
return heads
heads.append(m.group(1))
return heads