Cloner: use zuul_url always when project set
In the case of a post-merge pipeline (ie, one that
responds to ref-updated events) this increases the accuracy of
a multi-repo checkout by consulting the zuul merger when
cloning and updating the project in question. All other projects
are updated from the upstream git url. Previously all repos would
be cloned and updated from the upstream url. That is normally
fine, but in some cases they may actually lag behind, but the
merger will have the most current copy of the repo for the project
in question.
This is safe because we now ensure that mergers fully update the
branches and tags of their local copies.
The assertion in test_cache_dir is updated to reflict this change.
Its intent is to verify that the origin in a prepared repo is not
the cache (that would be detrimental since the cache will never
update). It did this by asserting that the origin was the upstream
url. However, with this change the origin may be the zuul_url (and
should be for project1 in this test). So the assertion is changed
to verify that the origin is the zuul url. A second assertion that
it is also not the cache is added for clarity and extra protection.
This test conveniently also tests cloning a repo which is not the
zuul_project, so add the original assertion back but modified for
that project. This way both variants are now tested.
Change-Id: If22d8cfbe591afe4f5516da1eb3b0be98b2de874
4 files changed