Implement git init

Allows creation of new git repo, may be of use in tests.
This commit is contained in:
erik 2023-03-02 14:31:15 +01:00
parent 0d36a8a66a
commit 99877b3fbf

View file

@ -212,6 +212,9 @@ class GitApi():
self.system_repository.run_checked('git', 'branch', '--show-current') self.system_repository.run_checked('git', 'branch', '--show-current')
return ''.join(self.system_repository.stdout).rstrip() return ''.join(self.system_repository.stdout).rstrip()
def init(self):
self.system_repository.run_checked('git', 'init')
def add_file(self, file_path: Path): def add_file(self, file_path: Path):
self.system_repository.run_checked('git', 'add', file_path) self.system_repository.run_checked('git', 'add', file_path)
return self.system_repository.stdout return self.system_repository.stdout