@@ -62,12 +62,8 @@ def get_completion_progress() -> Iterator['LanguageProjectData']:
6262
6363def get_month_ago_completion (clones_dir : str , repo : str ) -> float :
6464 repo_dir = Path (clones_dir , repo )
65- repo_obj = Repo (repo_dir )
66- current_commit = repo_obj .head .commit .hexsha
6765 subprocess .run (['git' , 'checkout' , 'HEAD@{30 days ago}' ], cwd = repo_dir , check = True )
68- month_ago_completion = get_completion (clones_dir , repo )[0 ]
69- subprocess .run (['git' , 'checkout' , current_commit ], cwd = repo_dir , check = True )
70- return month_ago_completion
66+ return get_completion (clones_dir , repo )[0 ]
7167
7268
7369def get_project_data (
@@ -80,7 +76,7 @@ def get_project_data(
8076 built = language .code in languages_built
8177 if repo :
8278 completion , translators_data , branch = get_completion (clones_dir , repo )
83- month_ago_completion = get_month_ago_completion (clones_dir , 'cpython' )
79+ month_ago_completion = get_month_ago_completion (clones_dir , repo )
8480 change = completion - month_ago_completion
8581 visitors_num = get_number_of_visitors (language .code , http ) if built else 0
8682 else :
@@ -133,4 +129,4 @@ class LanguageProjectData:
133129 Path ('index.html' ).write_text (output )
134130 Path ('index.json' ).write_text (
135131 json .dumps (completion_progress , indent = 2 , default = asdict )
136- )
132+ )
0 commit comments