示例#1
0
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));
}
示例#2
0
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;
}
示例#3
0
文件: rugged_tag.c 项目: 0CV0/rugged
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);
}
示例#4
0
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;
}