[hacktree] repo: Fix some bugs loading variants
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hacktree] repo: Fix some bugs loading variants
- Date: Sat, 15 Oct 2011 02:50:19 +0000 (UTC)
commit 9e0e4818352b338987428803ffa190168ab8843d
Author: Colin Walters <walters verbum org>
Date: Fri Oct 14 22:49:28 2011 -0400
repo: Fix some bugs loading variants
src/libhacktree/hacktree-repo.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/libhacktree/hacktree-repo.c b/src/libhacktree/hacktree-repo.c
index e7b07b7..5ee6ce1 100644
--- a/src/libhacktree/hacktree-repo.c
+++ b/src/libhacktree/hacktree-repo.c
@@ -54,7 +54,6 @@ struct _HacktreeRepoPrivate {
char *path;
GFile *repo_file;
char *head_ref_path;
- char *index_path;
char *objects_path;
gboolean inited;
@@ -70,7 +69,6 @@ hacktree_repo_finalize (GObject *object)
g_free (priv->path);
g_clear_object (&priv->repo_file);
g_free (priv->head_ref_path);
- g_free (priv->index_path);
g_free (priv->objects_path);
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->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->index_path = g_build_filename (priv->path, HACKTREE_REPO_DIR, "index", NULL);
return object;
}
@@ -284,7 +281,6 @@ load_gvariant_object_unknown (HacktreeRepo *self,
GVariant **out_variant,
GError **error)
{
- HacktreeRepoPrivate *priv = GET_PRIVATE (self);
GMappedFile *mfile = NULL;
gboolean ret = FALSE;
GVariant *ret_variant = NULL;
@@ -294,7 +290,7 @@ load_gvariant_object_unknown (HacktreeRepo *self,
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)
goto out;
else
@@ -320,7 +316,7 @@ load_gvariant_object_unknown (HacktreeRepo *self,
out:
if (!ret)
{
- if (!ret_variant)
+ if (ret_variant)
g_variant_unref (ret_variant);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]