Skip to content

Commit

Permalink
push: add --[no-]show-forced-updates passthrough to fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickstolee authored and dscho committed Jun 8, 2019
1 parent 9d1b32e commit dba6f56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin/pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ 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 struct option pull_options[] = {
/* Shared options */
Expand Down Expand Up @@ -240,6 +241,8 @@ 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_END()
};
Expand Down Expand Up @@ -549,6 +552,10 @@ 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 (repo) {
argv_array_push(&args, repo);
Expand Down

0 comments on commit dba6f56

Please sign in to comment.