We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 005e898 commit d84f96bCopy full SHA for d84f96b
commit0/harness/run_pytest_ids.py
@@ -84,10 +84,12 @@ def main(
84
if branch == "reference":
85
commit_id = example["reference_commit"]
86
else:
87
- if branch not in local_repo.branches:
88
- raise Exception(f"Branch {branch} does not exist.")
89
- local_branch = local_repo.branches[branch]
90
- commit_id = local_branch.commit.hexsha
+ try:
+ local_repo.git.checkout(branch)
+ local_branch = local_repo.branches[branch]
+ commit_id = local_branch.commit.hexsha
91
+ except Exception as e:
92
+ raise Exception(f"Problem checking out branch {branch}.\n{e}")
93
patch = generate_patch_between_commits(
94
local_repo, example["base_commit"], commit_id
95
)
0 commit comments