Skip to content

Commit a5c45e6

Browse files
Fix Rugged::Tree.diff to allow the first given tree to be nil.
1 parent 108d9e4 commit a5c45e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/rugged/rugged_tree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ static VALUE rb_git_diff_tree_to_tree(VALUE self, VALUE rb_repo, VALUE rb_tree,
391391
struct nogvl_diff_args args;
392392

393393
Data_Get_Struct(rb_repo, git_repository, repo);
394-
Data_Get_Struct(rb_tree, git_tree, tree);
394+
395+
if(RTEST(rb_tree))
396+
Data_Get_Struct(rb_tree, git_tree, tree);
395397

396398
if(RTEST(rb_other_tree))
397399
Data_Get_Struct(rb_other_tree, git_tree, other_tree);

0 commit comments

Comments
 (0)