Skip to content

Commit 7f9bc3c

Browse files
jeffhostetlerdscho
authored andcommitted
gvfs-helper: add --max-retries to prefetch verb
Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
1 parent 806116a commit 7f9bc3c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gvfs-helper.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@
105105
// The GVFS Protocol defines this value as a way to
106106
// request cached packfiles NEWER THAN this timestamp.
107107
//
108+
// --max-retries=<n> // defaults to "6"
109+
//
110+
// Number of retries after transient network errors.
111+
// Set to zero to disable such retries.
112+
//
108113
// server
109114
//
110115
// Interactive/sub-process mode. Listen for a series of commands
@@ -3755,6 +3760,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
37553760
static const char *since_str;
37563761
static struct option prefetch_options[] = {
37573762
OPT_STRING(0, "since", &since_str, N_("since"), N_("seconds since epoch")),
3763+
OPT_INTEGER('r', "max-retries", &gh__cmd_opts.max_retries,
3764+
N_("retries for transient network errors")),
37583765
OPT_END(),
37593766
};
37603767

@@ -3774,6 +3781,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
37743781
if (my_parse_since(since_str, &seconds_since_epoch))
37753782
die("could not parse 'since' field");
37763783
}
3784+
if (gh__cmd_opts.max_retries < 0)
3785+
gh__cmd_opts.max_retries = 0;
37773786

37783787
finish_init(1);
37793788

0 commit comments

Comments
 (0)