Fix logging of clone url

In the executor log we currently log the remote url of the project
instead of the real url from where we clone a copy which can be the
local cache. This leads to misinterpretation of the log which indicates
that on each job a clean clone is done. This is not the case so fix the
logging here.

Change-Id: I694c04c73fc39479d68fd3eb7268ddf8cdde4ba2
This commit is contained in:
Tobias Henkel 2018-07-04 08:55:12 +02:00 committed by Tobias Henkel
parent 02682856a0
commit bced2c6efb
1 changed files with 7 additions and 4 deletions

View File

@ -113,13 +113,16 @@ class Repo(object):
# If the repo does not exist, clone the repo.
rewrite_url = False
if not repo_is_cloned:
self.log.debug("Cloning from %s to %s" % (
redact_url(self.remote_url), self.local_path))
if self.cache_path:
self._git_clone(self.cache_path)
clone_url = self.cache_path
rewrite_url = True
else:
self._git_clone(self.remote_url)
clone_url = self.remote_url
self.log.debug("Cloning from %s to %s" % (
redact_url(clone_url), self.local_path))
self._git_clone(clone_url)
repo = git.Repo(self.local_path)
repo.git.update_environment(**self.env)
# Create local branches corresponding to all the remote branches