(barerepo: Repository)
| 198 | |
| 199 | |
| 200 | def test_hashfile(barerepo: Repository) -> None: |
| 201 | data = 'bazbarfoo' |
| 202 | handle, tempfile_path = tempfile.mkstemp() |
| 203 | with os.fdopen(handle, 'w') as fh: |
| 204 | fh.write(data) |
| 205 | hashed_sha1 = pygit2.hashfile(tempfile_path) |
| 206 | pathlib.Path(tempfile_path).unlink() |
| 207 | written_sha1 = barerepo.create_blob(data) |
| 208 | assert hashed_sha1 == written_sha1 |
| 209 | |
| 210 | |
| 211 | def test_conflicts_in_bare_repository(barerepo: Repository) -> None: |