Skip to content

Commit ceb87fa

Browse files
committed
add regression test for nil other tree, but valid index
1 parent aa0a03c commit ceb87fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/diff_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,4 +1187,12 @@ def test_other_is_wrong_type
11871187
end
11881188
assert_equal "A Rugged::Commit, Rugged::Tree or Rugged::Index instance is required", ex.message
11891189
end
1190+
1191+
def test_other_tree_is_an_index_but_tree_is_nil
1192+
repo = FixtureRepo.from_libgit2("diff")
1193+
1194+
diff = Rugged::Tree.diff repo, nil, repo.index
1195+
assert_equal 2, diff.size
1196+
assert_equal 2, diff.deltas.size
1197+
end
11901198
end

0 commit comments

Comments
 (0)