diff --git a/gvfs-helper.c b/gvfs-helper.c index e8e6fbbdd9f361..87f1a8ec563f55 100644 --- a/gvfs-helper.c +++ b/gvfs-helper.c @@ -105,6 +105,11 @@ // The GVFS Protocol defines this value as a way to // request cached packfiles NEWER THAN this timestamp. // +// --max-retries= // defaults to "6" +// +// Number of retries after transient network errors. +// Set to zero to disable such retries. +// // server // // Interactive/sub-process mode. Listen for a series of commands @@ -3781,6 +3786,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv) static const char *since_str; static struct option prefetch_options[] = { OPT_STRING(0, "since", &since_str, N_("since"), N_("seconds since epoch")), + OPT_INTEGER('r', "max-retries", &gh__cmd_opts.max_retries, + N_("retries for transient network errors")), OPT_END(), }; @@ -3800,6 +3807,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv) if (my_parse_since(since_str, &seconds_since_epoch)) die("could not parse 'since' field"); } + if (gh__cmd_opts.max_retries < 0) + gh__cmd_opts.max_retries = 0; finish_init(1);