]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/pull.c
Merge branch 'js/doc-patch-text'
[thirdparty/git.git] / builtin / pull.c
index 9dd32a115bbbfeedb1c1648348ddd32ccaa9b641..d25ff13a60f2d08efdc160c359364ab94a5b19ae 100644 (file)
@@ -128,6 +128,8 @@ static char *opt_update_shallow;
 static char *opt_refmap;
 static char *opt_ipv4;
 static char *opt_ipv6;
+static int opt_show_forced_updates = -1;
+static char *set_upstream;
 
 static struct option pull_options[] = {
        /* Shared options */
@@ -240,6 +242,11 @@ static struct option pull_options[] = {
        OPT_PASSTHRU('6',  "ipv6", &opt_ipv6, NULL,
                N_("use IPv6 addresses only"),
                PARSE_OPT_NOARG),
+       OPT_BOOL(0, "show-forced-updates", &opt_show_forced_updates,
+                N_("check for forced-updates on all updated branches")),
+       OPT_PASSTHRU(0, "set-upstream", &set_upstream, NULL,
+               N_("set upstream for git pull/fetch"),
+               PARSE_OPT_NOARG),
 
        OPT_END()
 };
@@ -549,6 +556,12 @@ static int run_fetch(const char *repo, const char **refspecs)
                argv_array_push(&args, opt_ipv4);
        if (opt_ipv6)
                argv_array_push(&args, opt_ipv6);
+       if (opt_show_forced_updates > 0)
+               argv_array_push(&args, "--show-forced-updates");
+       else if (opt_show_forced_updates == 0)
+               argv_array_push(&args, "--no-show-forced-updates");
+       if (set_upstream)
+               argv_array_push(&args, set_upstream);
 
        if (repo) {
                argv_array_push(&args, repo);