Skip to content

Commit 4cfc682

Browse files
committed
test_submodule works
1 parent 8f219b5 commit 4cfc682

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

‎git/objects/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def new_from_sha(cls, repo, sha1):
6060
:param sha1: 20 byte binary sha1"""
6161
if sha1 == cls.NULL_BIN_SHA:
6262
# the NULL binsha is always the root commit
63-
return get_object_type_by_name('commit')(repo, sha1)
63+
return get_object_type_by_name(b'commit')(repo, sha1)
6464
# END handle special case
6565
oinfo = repo.odb.info(sha1)
6666
inst = get_object_type_by_name(oinfo.type)(repo, oinfo.binsha)

‎git/test/test_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_get_object_type_by_name(self):
8686
assert base.Object in get_object_type_by_name(tname).mro()
8787
# END for each known type
8888

89-
assert_raises(ValueError, get_object_type_by_name, "doesntexist")
89+
assert_raises(ValueError, get_object_type_by_name, b"doesntexist")
9090

9191
def test_object_resolution(self):
9292
# objects must be resolved to shas so they compare equal

‎git/test/test_submodule.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _do_base_tests(self, rwrepo):
8080
assert isinstance(sm.branch_path, string_types)
8181

8282
# some commits earlier we still have a submodule, but its at a different commit
83-
smold = Submodule.iter_items(rwrepo, self.k_subm_changed).next()
83+
smold = next(Submodule.iter_items(rwrepo, self.k_subm_changed))
8484
assert smold.binsha != sm.binsha
8585
assert smold != sm # the name changed
8686

0 commit comments

Comments
 (0)