This assertion is complementary to the other. Also add a test.
---
Originally, I had included a change that automatically set the native
variable based upon the version passed in (so you only had to specify
one of version or native), but I'm no longer confident that is what you
want the API to be. This change is sufficient to catch the issue and
ensures 100% code coverage with the test.
git_repository: drop ensure_importer_branches_exist
Much like 1d658869b56b ("Create dsc branch on first use"), create the
pristine-tar necessary branches on first use, which all occurs within
the context manager in git_repository.py.
This should only result in one functional change, but should ensure
there are no side-effects of simply instantiating a GitUbuntuRepository
object and the helper function is no longer necessary.
The functional change is that when there is only publishing history in
one of Debian or Ubuntu, there will only be pristine-tar related
branches for the specific distribution. This requires, in turn, ensuring
that pristine_tar_list does not create any branches, so that `git ubuntu
build`'s usage continues to work as expected.
It is a separate issue as to whether these branches should exist in the
first place or not.
This will allow for importer tests to start with a given
Repo object, specify the modifications to it, and then
generate the expected result structurally. The original
and modified-copy can then be compared with the to-be-written
Repo comparator.
These classes are used to extend the Repo class to include their
corresponding refs.
This also requires changing when replace_placeholders is called for
Repo() objects. We want to be able to run tests against Repo() objects
which might be otherwise invalid, so we need to defer the
replace_placeholders() call until write().