repo: Fix some bugs loading variants
This commit is contained in:
parent
0b851a743e
commit
9e0e481835
|
|
@ -54,7 +54,6 @@ struct _HacktreeRepoPrivate {
|
||||||
char *path;
|
char *path;
|
||||||
GFile *repo_file;
|
GFile *repo_file;
|
||||||
char *head_ref_path;
|
char *head_ref_path;
|
||||||
char *index_path;
|
|
||||||
char *objects_path;
|
char *objects_path;
|
||||||
|
|
||||||
gboolean inited;
|
gboolean inited;
|
||||||
|
|
@ -70,7 +69,6 @@ hacktree_repo_finalize (GObject *object)
|
||||||
g_free (priv->path);
|
g_free (priv->path);
|
||||||
g_clear_object (&priv->repo_file);
|
g_clear_object (&priv->repo_file);
|
||||||
g_free (priv->head_ref_path);
|
g_free (priv->head_ref_path);
|
||||||
g_free (priv->index_path);
|
|
||||||
g_free (priv->objects_path);
|
g_free (priv->objects_path);
|
||||||
g_free (priv->current_head);
|
g_free (priv->current_head);
|
||||||
|
|
||||||
|
|
@ -136,7 +134,6 @@ hacktree_repo_constructor (GType gtype,
|
||||||
priv->repo_file = g_file_new_for_path (priv->path);
|
priv->repo_file = g_file_new_for_path (priv->path);
|
||||||
priv->head_ref_path = g_build_filename (priv->path, HACKTREE_REPO_DIR, "HEAD", NULL);
|
priv->head_ref_path = g_build_filename (priv->path, HACKTREE_REPO_DIR, "HEAD", NULL);
|
||||||
priv->objects_path = g_build_filename (priv->path, HACKTREE_REPO_DIR, "objects", NULL);
|
priv->objects_path = g_build_filename (priv->path, HACKTREE_REPO_DIR, "objects", NULL);
|
||||||
priv->index_path = g_build_filename (priv->path, HACKTREE_REPO_DIR, "index", NULL);
|
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
@ -284,7 +281,6 @@ load_gvariant_object_unknown (HacktreeRepo *self,
|
||||||
GVariant **out_variant,
|
GVariant **out_variant,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
HacktreeRepoPrivate *priv = GET_PRIVATE (self);
|
|
||||||
GMappedFile *mfile = NULL;
|
GMappedFile *mfile = NULL;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GVariant *ret_variant = NULL;
|
GVariant *ret_variant = NULL;
|
||||||
|
|
@ -294,7 +290,7 @@ load_gvariant_object_unknown (HacktreeRepo *self,
|
||||||
|
|
||||||
path = get_object_path (self, sha256, HACKTREE_OBJECT_TYPE_META);
|
path = get_object_path (self, sha256, HACKTREE_OBJECT_TYPE_META);
|
||||||
|
|
||||||
mfile = g_mapped_file_new (priv->index_path, FALSE, error);
|
mfile = g_mapped_file_new (path, FALSE, error);
|
||||||
if (mfile == NULL)
|
if (mfile == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
else
|
else
|
||||||
|
|
@ -320,7 +316,7 @@ load_gvariant_object_unknown (HacktreeRepo *self,
|
||||||
out:
|
out:
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
if (!ret_variant)
|
if (ret_variant)
|
||||||
g_variant_unref (ret_variant);
|
g_variant_unref (ret_variant);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue