Skip to content

Commit 8160bf1

Browse files
committed
add back create_branch in clone
1 parent 73b1de0 commit 8160bf1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

commit0/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def main() -> None:
4444
config.dataset_split,
4545
config.repo_split,
4646
config.base_dir,
47+
config.branch,
4748
)
4849
elif command == "build":
4950
commit0.harness.build.main(

commit0/harness/setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from datasets import load_dataset
55

66
from typing import Iterator
7-
from commit0.harness.utils import clone_repo
7+
from commit0.harness.utils import clone_repo, create_branch
88
from commit0.harness.constants import RepoInstance, SPLIT
99

1010

@@ -14,15 +14,18 @@
1414
logger = logging.getLogger(__name__)
1515

1616

17-
def main(dataset_name: str, dataset_split: str, repo_split: str, base_dir: str) -> None:
17+
def main(
18+
dataset_name: str, dataset_split: str, repo_split: str, base_dir: str, branch: str
19+
) -> None:
1820
dataset: Iterator[RepoInstance] = load_dataset(dataset_name, split=dataset_split) # type: ignore
1921
for example in dataset:
2022
repo_name = example["repo"].split("/")[-1]
2123
if repo_split != "all" and repo_name not in SPLIT[repo_split]:
2224
continue
2325
clone_url = f"https://github.com/{example['repo']}.git"
2426
clone_dir = os.path.abspath(os.path.join(base_dir, repo_name))
25-
clone_repo(clone_url, clone_dir, example["base_commit"], logger)
27+
local_repo = clone_repo(clone_url, clone_dir, example["base_commit"], logger)
28+
create_branch(local_repo, branch, logger)
2629

2730

2831
__all__ = []

0 commit comments

Comments
 (0)