<commit_before>import re
import os
import subprocess
import fileinput
import sys
import shutil

for repo_list_line in open('repositories.txt'):
    m = re.search('(\d+)\|github.com/OCA/(.*)', repo_list_line)
    repo_name = m.group(2)
    repo_id = m.group(1)
    print(repo_name)
    if not os.path.exists(repo_name):
        subprocess.call(['hub', 'clone', '--quiet', 'OCA/' + repo_name])

    os.chdir(repo_name)
    for version in ['6.1', '7.0', '8.0']:
        try:
            subprocess.check_call(['git', 'checkout', '--quiet', version])
            subprocess.check_call(['git', 'reset', '--hard'])
            subprocess.check_call(['git', 'clean', '-fxd'])
        except subprocess.CalledProcessError:
            continue

        new_lines = (
            "[![Runbot Build Status]"
            "(http://runbot.odoo-community.org/runbot/badge/flat/{0}/{1}.svg)]"
            "(http://runbot.odoo-community.org/runbot/repo/{0})\n".format(
                repo_id, version
            )
        )

        if not os.path.exists('.codeclimate.yml'):
            new_lines += (
                "[![Code Climate]"
                "(https://codeclimate.com/github/OCA/{0}/badges/gpa.svg)]"
                "(https://codeclimate.com/github/OCA/{0})\n".format(
                    repo_name
                )
            )
            shutil.copy('../.codeclimate.yml', '.')
<commit_msg>fail of reset or clean fail<commit_after>import re
import os
import subprocess
import fileinput
import sys
import shutil

for repo_list_line in open('repositories.txt'):
    m = re.search('(\d+)\|github.com/OCA/(.*)', repo_list_line)
    repo_name = m.group(2)
    repo_id = m.group(1)
    print(repo_name)
    if not os.path.exists(repo_name):
        subprocess.call(['hub', 'clone', '--quiet', 'OCA/' + repo_name])

    os.chdir(repo_name)
    for version in ['6.1', '7.0', '8.0']:
        try:
            subprocess.check_call(['git', 'checkout', '--quiet', version])
        except subprocess.CalledProcessError:
            continue

        subprocess.check_call(['git', 'reset', '--hard'])
        subprocess.check_call(['git', 'clean', '-fxd'])
        new_lines = (
            "[![Runbot Build Status]"
            "(http://runbot.odoo-community.org/runbot/badge/flat/{0}/{1}.svg)]"
            "(http://runbot.odoo-community.org/runbot/repo/{0})\n".format(
                repo_id, version
            )
        )

        if not os.path.exists('.codeclimate.yml'):
            new_lines += (
                "[![Code Climate]"
                "(https://codeclimate.com/github/OCA/{0}/badges/gpa.svg)]"
                "(https://codeclimate.com/github/OCA/{0})\n".format(
                    repo_name
                )
            )
            shutil.copy('../.codeclimate.yml', '.')

{'fraction_non_alphanumeric': 0.17621776504297995, 'fraction_numerical': 0.009312320916905445, 'mean_word_length': 1.952431289640592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6676708', 'n_tokens_mistral': 932, 'n_tokens_neox': 897, 'n_words': 147}