gittest: Unify logic to write blobs with production-level code
This MR moves the logic to write blobs from localrepo.WriteBlob()
into git.WriteBlob()
. This allows us to share the implementation between our gittest
and localrepo
packages, which improves test coverage of production-level code and reduces code duplication.