Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions codeflash/code_utils/git_worktree_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
def get_git_project_id() -> str:
"""Return the first commit sha of the repo."""
repo: Repo = git.Repo(search_parent_directories=True)
root_commits = list(repo.iter_commits(rev="HEAD", max_parents=0))
return root_commits[0].hexsha
return next(repo.iter_commits(rev="HEAD", max_parents=0)).hexsha


def create_worktree_snapshot_commit(worktree_dir: Path, commit_message: str) -> None:
Expand Down Expand Up @@ -97,7 +96,7 @@ def remove_worktree(worktree_dir: Path) -> None:
@lru_cache(maxsize=1)
def get_patches_dir_for_project() -> Path:
project_id = get_git_project_id() or ""
return Path(patches_dir / project_id)
return patches_dir / project_id


def get_patches_metadata() -> dict[str, Any]:
Expand Down
Loading