From c79d5a0af8b2f578300a0f657a1541371ab51d6c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 03 2014 10:35:59 +0000 Subject: Check if we match 2 or more groups in the regex, not just more than 2 Relates to #43 --- diff --git a/progit/hooks/files/progit_hook.py b/progit/hooks/files/progit_hook.py index 2bdbed9..43736e6 100644 --- a/progit/hooks/files/progit_hook.py +++ b/progit/hooks/files/progit_hook.py @@ -86,7 +86,7 @@ def generate_revision_change_log(new_commits_list): if motif.match(line): print 'fixes', motif.match(line).groups() project = None - if len(motif.match(line).groups()) > 2: + if len(motif.match(line).groups()) >= 2: project = motif.match(line).group(2) fixes_commit( commitid, motif.match(line).group(1), project @@ -95,7 +95,7 @@ def generate_revision_change_log(new_commits_list): if motif.match(line): print 'relates to', motif.match(line).groups() project = None - if len(motif.match(line).groups()) > 2: + if len(motif.match(line).groups()) >= 2: project = motif.match(line).group(2) relates_commit( commitid, motif.match(line).group(1), project