mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-05 16:21:20 +00:00
Run git init only if there is no repo present
This commit is contained in:
parent
2f5e8d11f3
commit
49e0efa4c9
@ -21,10 +21,14 @@ class SnapshotProvider:
|
||||
self._branch = 'master'
|
||||
self._branches = [self._branch]
|
||||
|
||||
self._init_repo()
|
||||
self._init_repo_if_needed()
|
||||
|
||||
def _init_repo(self):
|
||||
self._run(('git', 'init'))
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user