[hacktree] Do "bare" repositories by default
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hacktree] Do "bare" repositories by default
- Date: Wed, 19 Oct 2011 21:46:08 +0000 (UTC)
commit 961b1c80dbef4598ae0785aa1bf0bb1be9d69383
Author: Colin Walters <walters verbum org>
Date: Wed Oct 19 17:45:00 2011 -0400
Do "bare" repositories by default
Mixing the repository and checkouts is discouraged.
Makefile-src.am | 1 -
src/libostree/ostree-repo.c | 5 +++--
src/libostree/ostree-types.h | 33 ---------------------------------
src/libostree/ostree.h | 1 -
src/ot-builtin-init.c | 18 ++++++------------
5 files changed, 9 insertions(+), 49 deletions(-)
---
diff --git a/Makefile-src.am b/Makefile-src.am
index 68cd3b5..2c600d5 100644
--- a/Makefile-src.am
+++ b/Makefile-src.am
@@ -37,7 +37,6 @@ libostree_la_SOURCES = src/libostree/ostree.h \
src/libostree/ostree-core.h \
src/libostree/ostree-repo.c \
src/libostree/ostree-repo.h \
- src/libostree/ostree-types.h \
$(NULL)
libostree_la_CFLAGS = -I$(srcdir)/src/libostree -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(GIO_UNIX_CFLAGS)
libostree_la_LIBADD = libotutil.la $(GIO_UNIX_LIBS)
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 4c5b10b..0dfe67d 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -133,8 +133,9 @@ ostree_repo_constructor (GType gtype,
g_assert (priv->path != NULL);
priv->repo_file = ot_util_new_file_for_path (priv->path);
- priv->head_ref_path = g_build_filename (priv->path, OSTREE_REPO_DIR, "HEAD", NULL);
- priv->objects_path = g_build_filename (priv->path, OSTREE_REPO_DIR, "objects", NULL);
+
+ priv->head_ref_path = g_build_filename (priv->path, "HEAD", NULL);
+ priv->objects_path = g_build_filename (priv->path, "objects", NULL);
return object;
}
diff --git a/src/libostree/ostree.h b/src/libostree/ostree.h
index 75cced5..329d7c7 100644
--- a/src/libostree/ostree.h
+++ b/src/libostree/ostree.h
@@ -23,6 +23,5 @@
#include <ostree-core.h>
#include <ostree-repo.h>
-#include <ostree-types.h>
#endif
diff --git a/src/ot-builtin-init.c b/src/ot-builtin-init.c
index 9d86464..7e952af 100644
--- a/src/ot-builtin-init.c
+++ b/src/ot-builtin-init.c
@@ -37,12 +37,12 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
{
GOptionContext *context = NULL;
gboolean ret = FALSE;
- char *htdir_path = NULL;
+ char *otdir_path = NULL;
char *objects_path = NULL;
- GFile *htdir = NULL;
+ GFile *otdir = NULL;
GFile *objects_dir = NULL;
- context = g_option_context_new ("- Check the repository for consistency");
+ context = g_option_context_new ("- Initialize a new empty repository");
g_option_context_add_main_entries (context, options, NULL);
if (!g_option_context_parse (context, &argc, &argv, error))
@@ -51,13 +51,7 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
if (repo_path == NULL)
repo_path = ".";
- htdir_path = g_build_filename (repo_path, OSTREE_REPO_DIR, NULL);
- htdir = ot_util_new_file_for_path (htdir_path);
-
- if (!g_file_make_directory (htdir, NULL, error))
- goto out;
-
- objects_path = g_build_filename (htdir_path, "objects", NULL);
+ objects_path = g_build_filename (repo_path, "objects", NULL);
objects_dir = g_file_new_for_path (objects_path);
if (!g_file_make_directory (objects_dir, NULL, error))
goto out;
@@ -66,7 +60,7 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
out:
if (context)
g_option_context_free (context);
- g_free (htdir_path);
- g_clear_object (&htdir);
+ g_free (otdir_path);
+ g_clear_object (&otdir);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]