Skip to content

Commit 399ca6a

Browse files
derrickstoleedscho
authored andcommitted
push: add --[no-]show-forced-updates passthrough to fetch
1 parent cad1db2 commit 399ca6a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

builtin/pull.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static char *opt_update_shallow;
122122
static char *opt_refmap;
123123
static char *opt_ipv4;
124124
static char *opt_ipv6;
125+
static int opt_show_forced_updates = -1;
125126

126127
static struct option pull_options[] = {
127128
/* Shared options */
@@ -233,6 +234,8 @@ static struct option pull_options[] = {
233234
OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
234235
N_("use IPv6 addresses only"),
235236
PARSE_OPT_NOARG),
237+
OPT_BOOL(0, "show-forced-updates", &opt_show_forced_updates,
238+
N_("check for forced-updates on all updated branches")),
236239

237240
OPT_END()
238241
};
@@ -541,6 +544,10 @@ static int run_fetch(const char *repo, const char **refspecs)
541544
argv_array_push(&args, opt_ipv4);
542545
if (opt_ipv6)
543546
argv_array_push(&args, opt_ipv6);
547+
if (opt_show_forced_updates > 0)
548+
argv_array_push(&args, "--show-forced-updates");
549+
else if (opt_show_forced_updates == 0)
550+
argv_array_push(&args, "--no-show-forced-updates");
544551

545552
if (repo) {
546553
argv_array_push(&args, repo);

0 commit comments

Comments
 (0)