Skip to content

Commit

Permalink
Merge pull request #87 from Nikita-Barabanov/main
Browse files Browse the repository at this point in the history
Fix empty repo crash
  • Loading branch information
FrBrGeorge authored Oct 10, 2023
2 parents 07e9d13 + e6fec06 commit 2d69a9f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hworker/deliver/git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def download_all() -> None:
update_all()
for student_id in get_git_uids():
repo = git.Repo(local_path(student_id))
if not repo.heads:
get_logger(__name__).warning(f"Got empty repo from {student_id} student!")
continue
for task in get_tasks_list():
repo.git.checkout(repo.heads[0])
if os.path.isdir((task_path := Path(local_path(student_id), get_task_info(task).get("deliver_ID", "")))):
Expand Down

0 comments on commit 2d69a9f

Please sign in to comment.