The current hierarchy of test cases that create and blow away test
repositories in the ``setUp`` and ``tearDown`` methods is inadequate
for testing scenarios where multiple repositories must be edited,
e.g. testing push.
Extract the temporary repository behaviour into a context manager
class ``TemporaryRepository`` which can be used via the ``with``
keyword. The context manager's ``__enter__` method returns creates
the specified repository in a temporary directory and returns its
path. The temporary directory is removed in ``__exit__``.
Update the existing test case base classes to use the context
manager and invoke ``__enter__`` and ``__exit__`` in the ``setUp``
and ``tearDown`` methods respectively.
Finally, make some small tweaks to a handful of tests to get them
working under this new system.
There were two problems:
- Windows refuses to remove a file that is in use. Solution, close
the repo before cleaning the temporary directory.
- Windows refuses to remove a read-only file. Solution, change mode
to writable.
- create_repository
- IndexEntry.path
- Correct SHAs in Index iteration
- Opening a bare index & attempting to add to it
- Walker.reset
- Walker.push
- Walker.sort