static VALUE rb_git_tag_target_GET(VALUE self) { git_tag *tag; VALUE owner; RUGGED_OBJ_UNWRAP(self, git_tag, tag); RUGGED_OBJ_OWNER(self, owner); return rugged_object_new(owner, (git_object*)git_tag_target(tag)); }
static VALUE rb_git_commit_tree_GET(VALUE self) { git_commit *commit; const git_tree *tree; VALUE owner; RUGGED_OBJ_UNWRAP(self, git_commit, commit); RUGGED_OBJ_OWNER(self, owner); tree = git_commit_tree(commit); return tree ? rugged_object_new(owner, (git_object *)tree) : Qnil; }
static VALUE rb_git_tag_target_GET(VALUE self) { git_tag *tag; git_object *target; int error; VALUE owner; RUGGED_OBJ_UNWRAP(self, git_tag, tag); RUGGED_OBJ_OWNER(self, owner); error = git_tag_target(&target, tag); rugged_exception_check(error); return rugged_object_new(owner, target); }
static VALUE rb_git_commit_parents_GET(VALUE self) { git_commit *commit; git_commit *parent; unsigned int n; VALUE ret_arr, owner; RUGGED_OBJ_UNWRAP(self, git_commit, commit); RUGGED_OBJ_OWNER(self, owner); ret_arr = rb_ary_new(); for (n = 0; (parent = git_commit_parent(commit, n)) != NULL; n++) { rb_ary_store(ret_arr, n, rugged_object_new(owner, (git_object *)parent)); } return ret_arr; }