static VALUE rb_git_tree_entry_sha_SET(VALUE self, VALUE val) { rugged_tree_entry *tree_entry; git_oid id; Data_Get_Struct(self, rugged_tree_entry, tree_entry); Check_Type(val, T_STRING); rugged_exception_check(git_oid_mkstr(&id, RSTRING_PTR(val))); git_tree_entry_set_id(tree_entry->entry, &id); return Qnil; }
static VALUE rb_git_tree_entry_sha_SET(VALUE self, VALUE val) { rugged_tree_entry *tree_entry; git_oid id; Data_Get_Struct(self, rugged_tree_entry, tree_entry); Check_Type(val, T_STRING); if (git_oid_mkstr(&id, RSTRING_PTR(val)) < 0) rb_raise(rb_eTypeError, "Invalid SHA1 value"); git_tree_entry_set_id(tree_entry->entry, &id); return Qnil; }