aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/repo_manager.py
diff options
context:
space:
mode:
authorGravatar Oliver Chang <oliverchang@users.noreply.github.com>2020-04-14 11:38:23 +1000
committerGravatar GitHub <noreply@github.com>2020-04-14 11:38:23 +1000
commitaa045b9b37523ee79ee0f4971498625a8b9d0c4b (patch)
treed287f9c79d36d3e778786b3e716ac005dd4fda14 /infra/repo_manager.py
parent20f5e0571947d83d7f47ddef43a04706253b45c9 (diff)
Bisector fixes. (#3601)
- Copy /src from host instead of checking out repo on host. This fixes issues with dependencies in the main repo. - Add some more logging.
Diffstat (limited to 'infra/repo_manager.py')
-rw-r--r--infra/repo_manager.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/infra/repo_manager.py b/infra/repo_manager.py
index a6789fb0..d240ae1f 100644
--- a/infra/repo_manager.py
+++ b/infra/repo_manager.py
@@ -53,7 +53,9 @@ class RepoManager:
else:
self.repo_name = os.path.basename(self.repo_url).replace('.git', '')
self.repo_dir = os.path.join(self.base_dir, self.repo_name)
- self._clone()
+
+ if not os.path.exists(self.repo_dir):
+ self._clone()
def _clone(self):
"""Creates a clone of the repo in the specified directory.
@@ -136,7 +138,7 @@ class RepoManager:
ValueError: When either the old or new commit does not exist.
RuntimeError: When there is an error getting the commit list.
"""
-
+ self.fetch_unshallow()
if not self.commit_exists(old_commit):
raise ValueError('The old commit %s does not exist' % old_commit)
if not self.commit_exists(new_commit):
@@ -157,8 +159,8 @@ class RepoManager:
def fetch_unshallow(self):
"""Gets the current git repository history."""
- git_path = os.path.join(self.repo_dir, '.git', 'shallow')
- if os.path.exists(git_path):
+ shallow_file = os.path.join(self.repo_dir, '.git', 'shallow')
+ if os.path.exists(shallow_file):
utils.execute(['git', 'fetch', '--unshallow'],
self.repo_dir,
check_result=True)