Do not try to insert 0{40} objects
We use them as an obviously bogus value, but part of hardening the objectdb
paths we no longer allow all-zero object names, so use a slightly different
obviously bogus name instead.
@@ -192,24 +192,24 @@ class TreeUpdateTest < Rugged::TestCase
def test_treebuilder_add_nonexistent_fails
builder = Rugged::Tree::Builder.new(@repo, @repo.head.target.tree)
assert_raises Rugged::TreeError do
- builder << { :type => :blob, :name => "another-readme", :oid => "0000000000000000000000000000000000000000", :filemode => 0100644 }
+ builder << { :type => :blob, :name => "another-readme", :oid => "0000000000000000000000000000000000000001", :filemode => 0100644 }
end
end
def test_treebuilder_add_submodules_always_succeeds
builder = Rugged::Tree::Builder.new(@repo, @repo.head.target.tree)
- builder << { :type => :commit, :name => "submodule", :oid => "0000000000000000000000000000000000000000", :filemode => 0160000 }
+ builder << { :type => :commit, :name => "submodule", :oid => "0000000000000000000000000000000000000001", :filemode => 0160000 }
newtree = builder.write
- assert_equal "ce986db11f99880a0a087ba3220dba61e9afd918", newtree
+ assert_equal "731d4e5d79f60ed64687b7828e1d0528839fed6e", newtree
end
def test_treebuilder_add_nonexistent_can_pass
begin
Rugged::Settings['strict_object_creation'] = false
builder = Rugged::Tree::Builder.new(@repo, @repo.head.target.tree)
- builder << { :type => :blob, :name => "another-readme", :oid => "0000000000000000000000000000000000000000", :filemode => 0100644 }
+ builder << { :type => :blob, :name => "another-readme", :oid => "0000000000000000000000000000000000000001", :filemode => 0100644 }
newtree = builder.write
- assert_equal "7c98360ac03064bb67c6f0949e6a354155ce1b04", newtree
+ assert_equal "2e34ce696ea8d595b62b99ac20406f86c15d464a", newtree
ensure
Rugged::Settings['strict_object_creation'] = true
end
