GNOME Bugzilla – Bug 706762
main: Code cleanup by passing OstreeRepo * directly to builtins
Last modified: 2013-08-25 19:31:07 UTC
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.
Created attachment 253069 [details] [review] main: Code cleanup by passing OstreeRepo * directly to builtins
Review of attachment 253069 [details] [review]: Not sure I like how you shuffle file paths through a "repo" object for the init builtin, but OK. ::: src/ostree/ot-builtin-init.c @@ +55,3 @@ goto out; + repo_path = g_object_ref (ostree_repo_get_path (repo)); Are you sure this g_object_ref is correct? Why not just remove the gs_unref_object from above to prevent the extra work?
(In reply to comment #2) > Review of attachment 253069 [details] [review]: > > Not sure I like how you shuffle file paths through a "repo" object for the init > builtin, but OK. Yeah...the alternative would be special casing init at a higher level, basically pulling it into main.c. > ::: src/ostree/ot-builtin-init.c > @@ +55,3 @@ > goto out; > > + repo_path = g_object_ref (ostree_repo_get_path (repo)); > > Are you sure this g_object_ref is correct? Yep, the repo is transfer none. > Why not just remove the gs_unref_object from above to prevent the extra work? Mmm...ok.
Attachment 253069 [details] pushed as edfa76f - main: Code cleanup by passing OstreeRepo * directly to builtins