예제 #1
0
GgitRef *
_ggit_ref_wrap (git_reference *ref,
                gboolean       owned)
{
	GgitRef *gref;

	if (git_reference_is_branch (ref))
	{
		gref = GGIT_REF (_ggit_branch_wrap (ref));
	}
	else
	{
		gref = g_object_new (GGIT_TYPE_REF,
		                     "native", ref,
		                     NULL);
	}

	if (owned)
	{
		_ggit_native_set_destroy_func (gref,
		                               (GDestroyNotify)git_reference_free);
	}

	return gref;
}
예제 #2
0
GgitRemote *
_ggit_remote_wrap (git_remote *remote)
{
	GgitRemote *ret;

	ret = g_object_new (GGIT_TYPE_REMOTE, "native", remote, NULL);
	_ggit_native_set_destroy_func (ret, (GDestroyNotify)git_remote_free);

	return ret;
}
예제 #3
0
GgitTree *
_ggit_tree_wrap (git_tree *tree,
                 gboolean  owned)
{
	GgitTree *gtree;

	gtree = g_object_new (GGIT_TYPE_TREE,
	                      "native", tree,
	                      NULL);

	if (owned)
	{
		_ggit_native_set_destroy_func (gtree,
		                               (GDestroyNotify)git_object_free);
	}

	return gtree;
}
예제 #4
0
GgitTag *
_ggit_tag_wrap (git_tag  *tag,
                gboolean  owned)
{
	GgitTag *gtag;

	gtag = g_object_new (GGIT_TYPE_TAG,
	                     "native", tag,
	                     NULL);

	if (owned)
	{
		_ggit_native_set_destroy_func (gtag,
		                               (GDestroyNotify)git_object_free);
	}

	return gtag;
}
예제 #5
0
static void
ggit_config_init (GgitConfig *config)
{
	_ggit_native_set_destroy_func (config, (GDestroyNotify) git_config_free);
}