Skip to content

Commit 63620c3

Browse files
committed
return false on a missing path in Rugged::Tree::Builder.remove
1 parent f0ee3a3 commit 63620c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/rugged/rugged_tree.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,11 @@ static VALUE rb_git_treebuilder_remove(VALUE self, VALUE path)
815815
Check_Type(path, T_STRING);
816816

817817
error = git_treebuilder_remove(builder, StringValueCStr(path));
818-
if (error == GIT_ENOTFOUND)
818+
if (error == GIT_ENOTFOUND) {
819819
return Qfalse;
820+
} else if (error == GIT_ERROR && giterr_last()->klass == GITERR_TREE) {
821+
return Qfalse;
822+
}
820823

821824
rugged_exception_check(error);
822825
return Qtrue;

0 commit comments

Comments
 (0)