Skip to content

Commit d87bbbf

Browse files
jeffhostetlervdye
authored andcommitted
gvfs-helper: add --max-retries to prefetch verb
Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 3d3f274 commit d87bbbf

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
@@ -3792,6 +3797,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
37923797
static const char *since_str;
37933798
static struct option prefetch_options[] = {
37943799
OPT_STRING(0, "since", &since_str, N_("since"), N_("seconds since epoch")),
3800+
OPT_INTEGER('r', "max-retries", &gh__cmd_opts.max_retries,
3801+
N_("retries for transient network errors")),
37953802
OPT_END(),
37963803
};
37973804

@@ -3811,6 +3818,8 @@ static enum gh__error_code do_sub_cmd__prefetch(int argc, const char **argv)
38113818
if (my_parse_since(since_str, &seconds_since_epoch))
38123819
die("could not parse 'since' field");
38133820
}
3821+
if (gh__cmd_opts.max_retries < 0)
3822+
gh__cmd_opts.max_retries = 0;
38143823

38153824
finish_init(1);
38163825

0 commit comments

Comments
 (0)