|
|
|
@ -216,8 +216,12 @@ class GitApi():
|
|
|
|
|
self.system_api.run_checked('git', 'branch', '--show-current')
|
|
|
|
|
return ''.join(self.system_api.stdout).rstrip()
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.system_api.run_checked('git', 'init', '-b', 'main')
|
|
|
|
|
def init(self, default_branch: str = "main"):
|
|
|
|
|
self.system_api.run_checked('git', 'init', '-b', default_branch)
|
|
|
|
|
|
|
|
|
|
def set_user_config(self, email: str, name: str):
|
|
|
|
|
self.system_api.run_checked('git', 'config', 'user.email', email)
|
|
|
|
|
self.system_api.run_checked('git', 'config', 'user.name', name)
|
|
|
|
|
|
|
|
|
|
def add_file(self, file_path: Path):
|
|
|
|
|
self.system_api.run_checked('git', 'add', file_path)
|
|
|
|
|