From 4c44036995e597172b47436c36a2ce5e385ab949 Mon Sep 17 00:00:00 2001 From: Paul Schwind Date: Fri, 27 Oct 2023 00:37:25 +0200 Subject: [PATCH] Fix Git commit error with missing email and name (#164) --- athena/athena/helpers/programming/code_repository.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/athena/athena/helpers/programming/code_repository.py b/athena/athena/helpers/programming/code_repository.py index 3d0ebaf5e..fe314cb19 100644 --- a/athena/athena/helpers/programming/code_repository.py +++ b/athena/athena/helpers/programming/code_repository.py @@ -52,6 +52,9 @@ def get_repository(url: str, authorization_secret: Optional[str] = None) -> Repo repo_zip.extractall(cache_dir_path) if not (cache_dir_path / ".git").exists(): repo = Repo.init(cache_dir_path, initial_branch='main') + # Config username and email to prevent Git errors + repo.config_writer().set_value("user", "name", "athena").release() + repo.config_writer().set_value("user", "email", "doesnotexist.athena@cit.tum.de").release() repo.git.add(all=True, force=True) repo.git.commit('-m', 'Initial commit')