build.py currently has no tests, so it's difficult to add a test for
this fix. But this is a trivial and obvious improvement, so I think it's
worth landing without.
Now that we have unpinned pygit2, the newer version of pygit2 provides a
pygit2.Repository.descendant_of() method directly, so we can drop our
temporary implementation and adjust the single caller.
We retain the test to ensure that the implementation swap does not
change behaviour.
With LP: #1918967 fixed in snapcraft, we must match and change the
substring of the fingerprint used for the public key file supplied to
snapcraft; otherwise the build fails.
There were a few places where we were mocking with timezone-naive
objects when in reality they would be timezone-aware objects. This
caused spurious test failures when the tests were run in a non-UTC
environment. Fix these to be timezone-aware.
These failures aren't picked up by our CI since it runs in UTC. As these
were bugs in tests, it seems sufficient to just fix them without adding
tests for the tests.