def parse_repo(self, project):
        repo = git.Repo(project.git_repo_path)
        starting_commit = project.git_repo_commit
        commits = repo.commits()
        for x in commits:
            if starting_commit == x.id:
                starting_commit = x
        index = commits.index(starting_commit)
        commits = commits[:index]
        match_string = re.compile('Fixes #[\d]+')
        issue_matches = []
        for x in commits:
            for message in match_string.findall(x.message):
                issue_matches.append(x)

        number_string = re.compile('\d+')
        closed_status = models.Status.objects.get(slug="closed")
        for x in issue_matches:
            for y in number_string.findall(x.message):
                try:
                    issue = models.Issue.objects.get(id=y)
                    if issue.status is closed_status:
                        continue
                except __HOLE__:
                    continue

                issue.status=closed_status
                issue.save()
                comment = Comment()
                comment.user_name = "vcs_bot"
                comment.user_email = "vcs_bot@test.com"
                comment.content_type = self.content_type
                comment.object_pk = issue.id
                comment.comment = x.message
                comment.site = Site.objects.get(id=settings.SITE_ID)
                comment.save()
                project.git_repo_commit = x.id
                project.save()
dataset/ETHPy150Open f4nt/djtracker/djtracker/management/commands/git_poller.py/Command.parse_repo