diff options
author | Colin Walters <walters@verbum.org> | 2013-08-25 15:11:05 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-08-25 15:28:23 -0400 |
commit | edfa76fad5d2fc92d753c3317333200d552b99e9 (patch) | |
tree | 6b76d3928db6c3dbcfde5292b58b5b06f4163ebd /src/ostree/ot-builtin-rev-parse.c | |
parent | 6c61b1910714c5bde7f35594ab7fcd980d03c8f1 (diff) | |
download | ostree-edfa76fad5d2fc92d753c3317333200d552b99e9.tar.gz |
main: Code cleanup by passing OstreeRepo * directly to builtins
It turns out every builtin (with one special exception) that takes a
repo argument did the same thing; let's just centralize it. The
special exception was "ostree init --repo=foo" where foo is expected
to *not* actually be a repo. In that case, simply skip the
ostree_repo_check() invocation.
https://bugzilla.gnome.org/show_bug.cgi?id=706762
Diffstat (limited to 'src/ostree/ot-builtin-rev-parse.c')
-rw-r--r-- | src/ostree/ot-builtin-rev-parse.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ostree/ot-builtin-rev-parse.c b/src/ostree/ot-builtin-rev-parse.c index a1349a68..ffd5c78b 100644 --- a/src/ostree/ot-builtin-rev-parse.c +++ b/src/ostree/ot-builtin-rev-parse.c @@ -31,13 +31,12 @@ static GOptionEntry options[] = { }; gboolean -ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error) +ostree_builtin_rev_parse (int argc, char **argv, OstreeRepo *repo, GCancellable *cancellable, GError **error) { GOptionContext *context; gboolean ret = FALSE; const char *rev = "master"; int i; - gs_unref_object OstreeRepo *repo = NULL; gs_free char *resolved_rev = NULL; gs_unref_variant GVariant *variant = NULL; gs_free char *formatted_variant = NULL; @@ -48,10 +47,6 @@ ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GCancellable if (!g_option_context_parse (context, &argc, &argv, error)) goto out; - repo = ostree_repo_new (repo_path); - if (!ostree_repo_check (repo, error)) - goto out; - if (argc < 2) { ot_util_usage_error (context, "REV must be specified", error); |