mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-05 16:31:21 +00:00
Run git init only if there is no repo present
This commit is contained in:
parent
2f5e8d11f3
commit
49e0efa4c9
@ -21,11 +21,15 @@ class SnapshotProvider:
|
||||
self._branch = 'master'
|
||||
self._branches = [self._branch]
|
||||
|
||||
self._init_repo()
|
||||
self._init_repo_if_needed()
|
||||
|
||||
def _init_repo(self):
|
||||
def _init_repo_if_needed(self):
|
||||
if not self._repo_is_initialized():
|
||||
self._run(('git', 'init'))
|
||||
|
||||
def _repo_is_initialized(self):
|
||||
return self._run(('git', 'status')).returncode == 0
|
||||
|
||||
def take_snapshot(self):
|
||||
if self._head_detached:
|
||||
self._checkout_branch_from_head()
|
||||
|
Loading…
Reference in New Issue
Block a user