@@ -89,7 +89,7 @@ def test_tree_from_revision(self):
8989assert self .rorepo .tree (tree )== tree
9090
9191# 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' )
9393
9494def test_commit_from_revision (self ):
9595commit = self .rorepo .commit ('0.1.4' )
@@ -533,7 +533,7 @@ def test_rev_parse(self):
533533obj = self ._assert_rev_parse (path_section )
534534assert obj .type == ref .object .type
535535num_resolved += 1
536- except BadObject :
536+ except ( BadName , BadObject ) :
537537print ("failed on %s" % path_section )
538538# is fine, in case we have something like 112, which belongs to remotes/rname/merge-requests/112
539539pass
@@ -698,6 +698,9 @@ def test_empty_repo(self, rw_dir):
698698# actually, when trying to create a new branch without a commit, git itself fails
699699# We should, however, not fail ungracefully
700700self .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 )
701704
702705new_file_path = os .path .join (rw_dir ,"new_file.ext" )
703706touch (new_file_path )