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-diff.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-diff.c')
-rw-r--r-- | src/ostree/ot-builtin-diff.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ostree/ot-builtin-diff.c b/src/ostree/ot-builtin-diff.c index 7abe071f..7bd772ca 100644 --- a/src/ostree/ot-builtin-diff.c +++ b/src/ostree/ot-builtin-diff.c @@ -115,13 +115,12 @@ object_set_total_size (OstreeRepo *repo, } gboolean -ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GCancellable *cancellable, GError **error) +ostree_builtin_diff (int argc, char **argv, OstreeRepo *repo, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; GOptionContext *context; const char *src; const char *target; - gs_unref_object OstreeRepo *repo = NULL; gs_free char *src_prev = NULL; gs_unref_object GFile *srcf = NULL; gs_unref_object GFile *targetf = NULL; @@ -135,10 +134,6 @@ ostree_builtin_diff (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 < 2) { gchar *help = g_option_context_get_help (context, TRUE, NULL); |