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-show.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-show.c')
-rw-r--r-- | src/ostree/ot-builtin-show.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ostree/ot-builtin-show.c b/src/ostree/ot-builtin-show.c index 91d2b438..b7f2138e 100644 --- a/src/ostree/ot-builtin-show.c +++ b/src/ostree/ot-builtin-show.c @@ -178,12 +178,11 @@ print_if_found (OstreeRepo *repo, } gboolean -ostree_builtin_show (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error) +ostree_builtin_show (int argc, char **argv, OstreeRepo *repo, GCancellable *cancellable, GError **error) { GOptionContext *context; gboolean ret = FALSE; const char *rev; - gs_unref_object OstreeRepo *repo = NULL; gs_free char *resolved_rev = NULL; context = g_option_context_new ("OBJECT - Output a metadata object"); @@ -192,10 +191,6 @@ ostree_builtin_show (int argc, char **argv, GFile *repo_path, GCancellable *canc 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 <= 1) { ot_util_usage_error (context, "An object argument is required", error); |