when we are done processing the repo, we check it

out to the main/master branch
This commit is contained in:
Karma Riuk
2025-03-17 10:49:37 +01:00
parent f926be95f9
commit 47763f5803

View File

@ -70,6 +70,10 @@ def ensure_full_history(repo_path: str) -> None:
if result.stdout.strip() == "true":
run_git_cmd(["fetch", "--unshallow"], repo_path)
def reset_repo_to_latest_commit(repo_path: str) -> None:
current_branch = run_git_cmd(["rev-parse", "--abbrev-ref", "HEAD"], repo_path).stdout.strip()
run_git_cmd(["checkout", current_branch], repo_path)
def process_pull(repo: Repository, pr: PullRequest, dataset: Dataset, repos_dir: str):
commits = list(pr.get_commits())
if not commits:
@ -144,6 +148,7 @@ def process_pull(repo: Repository, pr: PullRequest, dataset: Dataset, repos_dir:
entry.metadata.successful = False
finally:
build_handler.clean_repo()
reset_repo_to_latest_commit(repo_path)
dataset.to_json(args.output)