libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.61k stars 385 forks source link

A few bytes-oriented interfaces #1029

Closed nabijaczleweli closed 4 years ago

nabijaczleweli commented 4 years ago

As seen on the complimentary git.sr.ht branch.

Ref: #1028

jdavid commented 4 years ago

Thanks @nabijaczleweli , looks good, just missing the unit tests.

nabijaczleweli commented 4 years ago

Tests added

nabijaczleweli commented 4 years ago

hm, the test failing on NT is

__________________________ test_lookup_branch_local ___________________________
    def test_lookup_branch_local(testrepo):
        assert testrepo.lookup_branch('not-exists') is None
        assert testrepo.lookup_branch(b'not-exists') is None
>       assert testrepo.lookup_branch(b'\xb1') is None
E       _pygit2.InvalidSpecError

I'm assuming this is because it can't be sensibly converted to UTF-16 or it's just outside the NTFS Windows namespace; wrapped this in a check for os.name=="posix"