@@ -89,7 +89,7 @@ def test_tree_from_revision(self):
89
89
assert self .rorepo .tree (tree ) == tree
90
90
91
91
# try from invalid revision that does not exist
92
- self .failUnlessRaises (BadObject , self .rorepo .tree , 'hello world' )
92
+ self .failUnlessRaises (BadName , self .rorepo .tree , 'hello world' )
93
93
94
94
def test_commit_from_revision (self ):
95
95
commit = self .rorepo .commit ('0.1.4' )
@@ -533,7 +533,7 @@ def test_rev_parse(self):
533
533
obj = self ._assert_rev_parse (path_section )
534
534
assert obj .type == ref .object .type
535
535
num_resolved += 1
536
- except BadObject :
536
+ except ( BadName , BadObject ) :
537
537
print ("failed on %s" % path_section )
538
538
# is fine, in case we have something like 112, which belongs to remotes/rname/merge-requests/112
539
539
pass
@@ -698,6 +698,9 @@ def test_empty_repo(self, rw_dir):
698
698
# actually, when trying to create a new branch without a commit, git itself fails
699
699
# We should, however, not fail ungracefully
700
700
self .failUnlessRaises (BadName , r .create_head , 'foo' )
701
+ self .failUnlessRaises (BadName , r .create_head , 'master' )
702
+ # It's expected to not be able to access a tree
703
+ self .failUnlessRaises (ValueError , r .tree )
701
704
702
705
new_file_path = os .path .join (rw_dir , "new_file.ext" )
703
706
touch (new_file_path )
0 commit comments