diff options
author | Dan Nicholson <nicholson@endlessm.com> | 2015-06-08 10:11:11 -0700 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-06-14 08:49:35 -0400 |
commit | 5af7e8e8c242aabf3a65d317f833aee5396bc545 (patch) | |
tree | 3d3c766d0eb6dc186d83862e8ad16944c2b7b218 /src/ostree/ot-builtin-pull-local.c | |
parent | 91d7f3fa0dd976ce4068b5e1ae47132b2b16bc3d (diff) | |
download | ostree-5af7e8e8c242aabf3a65d317f833aee5396bc545.tar.gz |
pull-local: Support --depth option
Like pull, allow pull-local to mirror another another repository by
specifying how many parents to traverse.
https://bugzilla.gnome.org/show_bug.cgi?id=750581
Diffstat (limited to 'src/ostree/ot-builtin-pull-local.c')
-rw-r--r-- | src/ostree/ot-builtin-pull-local.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c index 94db6917..ed87d806 100644 --- a/src/ostree/ot-builtin-pull-local.c +++ b/src/ostree/ot-builtin-pull-local.c @@ -32,10 +32,12 @@ static char *opt_remote; static gboolean opt_disable_fsync; +static int opt_depth = 0; static GOptionEntry options[] = { { "remote", 0, 0, G_OPTION_ARG_STRING, &opt_remote, "Add REMOTE to refspec", "REMOTE" }, { "disable-fsync", 0, 0, G_OPTION_ARG_NONE, &opt_disable_fsync, "Do not invoke fsync()", NULL }, + { "depth", 0, 0, G_OPTION_ARG_INT, &opt_depth, "Traverse DEPTH parents (-1=infinite) (default: 0)", "DEPTH" }, { NULL } }; @@ -137,6 +139,8 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr if (opt_remote) g_variant_builder_add (&builder, "{s@v}", "override-remote-name", g_variant_new_variant (g_variant_new_string (opt_remote))); + g_variant_builder_add (&builder, "{s@v}", "depth", + g_variant_new_variant (g_variant_new_int32 (opt_depth))); if (!ostree_repo_pull_with_options (repo, src_repo_uri, g_variant_builder_end (&builder), |