Method: Rugged::Tree::Builder#remove
- Defined in:
- ext/rugged/rugged_tree.c
permalink #remove(path) ⇒ Boolean
Remove an entry from builder
by its relative path
.
Returns true
if the entry was successfully removed, or false
if the entry was not found.
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 |
# File 'ext/rugged/rugged_tree.c', line 830
static VALUE rb_git_treebuilder_remove(VALUE self, VALUE path)
{
git_treebuilder *builder;
int error;
Data_Get_Struct(self, git_treebuilder, builder);
Check_Type(path, T_STRING);
error = git_treebuilder_remove(builder, StringValueCStr(path));
if (error == GIT_ENOTFOUND) {
return Qfalse;
} else if (error == GIT_ERROR && giterr_last()->klass == GITERR_TREE) {
return Qfalse;
}
rugged_exception_check(error);
return Qtrue;
}
|