Merge branch 'rs/pull-options-sync-code-and-doc'
"git pull" shares many options with underlying "git fetch", but some of them were not documented and some of those that would make sense to pass down were not passed down. * rs/pull-options-sync-code-and-doc: pull: pass documented fetch options on pull: remove --update-head-ok from documentation
This commit is contained in:
commit
9f471e4b95
@ -204,7 +204,6 @@ ifndef::git-pull[]
|
|||||||
recursion (such as settings in linkgit:gitmodules[5] and
|
recursion (such as settings in linkgit:gitmodules[5] and
|
||||||
linkgit:git-config[1]) override this option, as does
|
linkgit:git-config[1]) override this option, as does
|
||||||
specifying --[no-]recurse-submodules directly.
|
specifying --[no-]recurse-submodules directly.
|
||||||
endif::git-pull[]
|
|
||||||
|
|
||||||
-u::
|
-u::
|
||||||
--update-head-ok::
|
--update-head-ok::
|
||||||
@ -214,6 +213,7 @@ endif::git-pull[]
|
|||||||
to communicate with 'git fetch', and unless you are
|
to communicate with 'git fetch', and unless you are
|
||||||
implementing your own Porcelain you are not supposed to
|
implementing your own Porcelain you are not supposed to
|
||||||
use it.
|
use it.
|
||||||
|
endif::git-pull[]
|
||||||
|
|
||||||
--upload-pack <upload-pack>::
|
--upload-pack <upload-pack>::
|
||||||
When given, and the repository to fetch from is handled
|
When given, and the repository to fetch from is handled
|
||||||
|
@ -110,6 +110,7 @@ static char *opt_ipv4;
|
|||||||
static char *opt_ipv6;
|
static char *opt_ipv6;
|
||||||
static int opt_show_forced_updates = -1;
|
static int opt_show_forced_updates = -1;
|
||||||
static char *set_upstream;
|
static char *set_upstream;
|
||||||
|
static struct argv_array opt_fetch = ARGV_ARRAY_INIT;
|
||||||
|
|
||||||
static struct option pull_options[] = {
|
static struct option pull_options[] = {
|
||||||
/* Shared options */
|
/* Shared options */
|
||||||
@ -207,6 +208,15 @@ static struct option pull_options[] = {
|
|||||||
OPT_PASSTHRU(0, "depth", &opt_depth, N_("depth"),
|
OPT_PASSTHRU(0, "depth", &opt_depth, N_("depth"),
|
||||||
N_("deepen history of shallow clone"),
|
N_("deepen history of shallow clone"),
|
||||||
0),
|
0),
|
||||||
|
OPT_PASSTHRU_ARGV(0, "shallow-since", &opt_fetch, N_("time"),
|
||||||
|
N_("deepen history of shallow repository based on time"),
|
||||||
|
0),
|
||||||
|
OPT_PASSTHRU_ARGV(0, "shallow-exclude", &opt_fetch, N_("revision"),
|
||||||
|
N_("deepen history of shallow clone, excluding rev"),
|
||||||
|
0),
|
||||||
|
OPT_PASSTHRU_ARGV(0, "deepen", &opt_fetch, N_("n"),
|
||||||
|
N_("deepen history of shallow clone"),
|
||||||
|
0),
|
||||||
OPT_PASSTHRU(0, "unshallow", &opt_unshallow, NULL,
|
OPT_PASSTHRU(0, "unshallow", &opt_unshallow, NULL,
|
||||||
N_("convert to a complete repository"),
|
N_("convert to a complete repository"),
|
||||||
PARSE_OPT_NONEG | PARSE_OPT_NOARG),
|
PARSE_OPT_NONEG | PARSE_OPT_NOARG),
|
||||||
@ -216,12 +226,19 @@ static struct option pull_options[] = {
|
|||||||
OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
|
OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
|
||||||
N_("specify fetch refmap"),
|
N_("specify fetch refmap"),
|
||||||
PARSE_OPT_NONEG),
|
PARSE_OPT_NONEG),
|
||||||
|
OPT_PASSTHRU_ARGV('o', "server-option", &opt_fetch,
|
||||||
|
N_("server-specific"),
|
||||||
|
N_("option to transmit"),
|
||||||
|
0),
|
||||||
OPT_PASSTHRU('4', "ipv4", &opt_ipv4, NULL,
|
OPT_PASSTHRU('4', "ipv4", &opt_ipv4, NULL,
|
||||||
N_("use IPv4 addresses only"),
|
N_("use IPv4 addresses only"),
|
||||||
PARSE_OPT_NOARG),
|
PARSE_OPT_NOARG),
|
||||||
OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
|
OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
|
||||||
N_("use IPv6 addresses only"),
|
N_("use IPv6 addresses only"),
|
||||||
PARSE_OPT_NOARG),
|
PARSE_OPT_NOARG),
|
||||||
|
OPT_PASSTHRU_ARGV(0, "negotiation-tip", &opt_fetch, N_("revision"),
|
||||||
|
N_("report that we have only objects reachable from this object"),
|
||||||
|
0),
|
||||||
OPT_BOOL(0, "show-forced-updates", &opt_show_forced_updates,
|
OPT_BOOL(0, "show-forced-updates", &opt_show_forced_updates,
|
||||||
N_("check for forced-updates on all updated branches")),
|
N_("check for forced-updates on all updated branches")),
|
||||||
OPT_PASSTHRU(0, "set-upstream", &set_upstream, NULL,
|
OPT_PASSTHRU(0, "set-upstream", &set_upstream, NULL,
|
||||||
@ -567,6 +584,7 @@ static int run_fetch(const char *repo, const char **refspecs)
|
|||||||
argv_array_push(&args, "--no-show-forced-updates");
|
argv_array_push(&args, "--no-show-forced-updates");
|
||||||
if (set_upstream)
|
if (set_upstream)
|
||||||
argv_array_push(&args, set_upstream);
|
argv_array_push(&args, set_upstream);
|
||||||
|
argv_array_pushv(&args, opt_fetch.argv);
|
||||||
|
|
||||||
if (repo) {
|
if (repo) {
|
||||||
argv_array_push(&args, repo);
|
argv_array_push(&args, repo);
|
||||||
|
Loading…
Reference in New Issue
Block a user