From 99877b3fbf1220d1601c6be8e0d719ac3d279e50 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 2 Mar 2023 14:31:15 +0100 Subject: [PATCH] Implement git init Allows creation of new git repo, may be of use in tests. --- infrastructure_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/infrastructure_api.py b/infrastructure_api.py index 2490686..125fb57 100644 --- a/infrastructure_api.py +++ b/infrastructure_api.py @@ -212,6 +212,9 @@ class GitApi(): self.system_repository.run_checked('git', 'branch', '--show-current') return ''.join(self.system_repository.stdout).rstrip() + def init(self): + self.system_repository.run_checked('git', 'init') + def add_file(self, file_path: Path): self.system_repository.run_checked('git', 'add', file_path) return self.system_repository.stdout