Skip to content

Commit 9a9294b

Browse files
author
Edward Thomson
committed
Tree::Builder: test that we can add a submodule
1 parent 49a83b1 commit 9a9294b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/tree_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ def test_treebuilder_add_nonexistent_fails
157157
end
158158
end
159159

160+
def test_treebuilder_add_submodules_always_succeeds
161+
builder = Rugged::Tree::Builder.new(@repo, @repo.head.target.tree)
162+
builder << { :type => :commit, :name => "submodule", :oid => "0000000000000000000000000000000000000000", :filemode => 0160000 }
163+
newtree = builder.write
164+
assert_equal "ce986db11f99880a0a087ba3220dba61e9afd918", newtree
165+
end
166+
160167
def test_treebuilder_add_nonexistent_can_pass
161168
begin
162169
Rugged::Settings['strict_object_creation'] = false

0 commit comments

Comments
 (0)