This allows a Source to be created with a predefined list of versions in
debian/changelog. This is useful, for example, for control of changelog
parents during testing.
Since it is common to take a GitUbuntuRepository instance env property
and then adjust it, make sure that modifying the dictionary returned
from the property getter does not modify the dictionary owned by the
instance itself. This adds some robustness against this common use
pattern.
Instead of using the GitUbuntuRepository.git_run method, use the top
level one instead.
This reduces dependency on the state of the GitUbuntuRepository class
instance with the goal of making this method into a classmethod.
This change should result in no functional changes. It does change the
resulting git call from using --work-tree to setting GIT_WORKTREE
instead. However this should not change git's behaviour, and we already
have tests for this method to help ensure this.
Instead of having two separate implementations, have the
GitUbuntuRepository.git_run method use the top level git_run function
for its implementation.
This should not introduce any functional changes.
The only differences now between the method and the function are:
1. The caller doesn't have to look up the underlying pygit2.Repository
on the GitUbuntuRepository directly, so it's a useful shortcut.
2. To preserve existing behaviour that currently doesn't have tests,
the method uses an initial environment identical to the process
environment at the time of construction of the GitUbuntuRepository
instance, instead of the environment at the time of the functional
call. This is intentionally left for a future change to simplify
things after we have better test coverage.