mirror of
https://github.com/git/git
synced 2024-10-02 14:45:21 +00:00
Merge branch 'rs/i18n-cannot-be-used-together' into maint-2.43
Clean-up code that handles combinations of incompatible options. * rs/i18n-cannot-be-used-together: i18n: factorize even more 'incompatible options' messages
This commit is contained in:
commit
25e2039cf6
|
@ -967,7 +967,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bundle_uri && deepen)
|
if (bundle_uri && deepen)
|
||||||
die(_("--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-exclude"));
|
die(_("options '%s' and '%s' cannot be used together"),
|
||||||
|
"--bundle-uri",
|
||||||
|
"--depth/--shallow-since/--shallow-exclude");
|
||||||
|
|
||||||
repo_name = argv[0];
|
repo_name = argv[0];
|
||||||
|
|
||||||
|
|
|
@ -577,7 +577,8 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
|
||||||
if (o.mode == MODE_TRIVIAL)
|
if (o.mode == MODE_TRIVIAL)
|
||||||
die(_("--trivial-merge is incompatible with all other options"));
|
die(_("--trivial-merge is incompatible with all other options"));
|
||||||
if (merge_base)
|
if (merge_base)
|
||||||
die(_("--merge-base is incompatible with --stdin"));
|
die(_("options '%s' and '%s' cannot be used together"),
|
||||||
|
"--merge-base", "--stdin");
|
||||||
line_termination = '\0';
|
line_termination = '\0';
|
||||||
while (strbuf_getline_lf(&buf, stdin) != EOF) {
|
while (strbuf_getline_lf(&buf, stdin) != EOF) {
|
||||||
struct strbuf **split;
|
struct strbuf **split;
|
||||||
|
|
|
@ -279,7 +279,8 @@ static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
|
||||||
|
|
||||||
opt_name = optnamearg(opt, arg, flags);
|
opt_name = optnamearg(opt, arg, flags);
|
||||||
other_opt_name = optnamearg(elem->opt, elem->arg, elem->flags);
|
other_opt_name = optnamearg(elem->opt, elem->arg, elem->flags);
|
||||||
error(_("%s is incompatible with %s"), opt_name, other_opt_name);
|
error(_("options '%s' and '%s' cannot be used together"),
|
||||||
|
opt_name, other_opt_name);
|
||||||
free(opt_name);
|
free(opt_name);
|
||||||
free(other_opt_name);
|
free(other_opt_name);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -2403,8 +2403,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
|
||||||
revs->left_right = 1;
|
revs->left_right = 1;
|
||||||
} else if (!strcmp(arg, "--left-only")) {
|
} else if (!strcmp(arg, "--left-only")) {
|
||||||
if (revs->right_only)
|
if (revs->right_only)
|
||||||
die("--left-only is incompatible with --right-only"
|
die(_("options '%s' and '%s' cannot be used together"),
|
||||||
" or --cherry");
|
"--left-only", "--right-only/--cherry");
|
||||||
revs->left_only = 1;
|
revs->left_only = 1;
|
||||||
} else if (!strcmp(arg, "--right-only")) {
|
} else if (!strcmp(arg, "--right-only")) {
|
||||||
if (revs->left_only)
|
if (revs->left_only)
|
||||||
|
|
|
@ -376,7 +376,7 @@ test_expect_success 'OPT_CMDMODE() detects incompatibility (1)' '
|
||||||
test_must_be_empty output &&
|
test_must_be_empty output &&
|
||||||
test_grep "mode1" output.err &&
|
test_grep "mode1" output.err &&
|
||||||
test_grep "mode2" output.err &&
|
test_grep "mode2" output.err &&
|
||||||
test_grep "is incompatible with" output.err
|
test_grep "cannot be used together" output.err
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'OPT_CMDMODE() detects incompatibility (2)' '
|
test_expect_success 'OPT_CMDMODE() detects incompatibility (2)' '
|
||||||
|
@ -384,7 +384,7 @@ test_expect_success 'OPT_CMDMODE() detects incompatibility (2)' '
|
||||||
test_must_be_empty output &&
|
test_must_be_empty output &&
|
||||||
test_grep "mode2" output.err &&
|
test_grep "mode2" output.err &&
|
||||||
test_grep "set23" output.err &&
|
test_grep "set23" output.err &&
|
||||||
test_grep "is incompatible with" output.err
|
test_grep "cannot be used together" output.err
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'OPT_CMDMODE() detects incompatibility (3)' '
|
test_expect_success 'OPT_CMDMODE() detects incompatibility (3)' '
|
||||||
|
@ -392,7 +392,7 @@ test_expect_success 'OPT_CMDMODE() detects incompatibility (3)' '
|
||||||
test_must_be_empty output &&
|
test_must_be_empty output &&
|
||||||
test_grep "mode2" output.err &&
|
test_grep "mode2" output.err &&
|
||||||
test_grep "set23" output.err &&
|
test_grep "set23" output.err &&
|
||||||
test_grep "is incompatible with" output.err
|
test_grep "cannot be used together" output.err
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'OPT_CMDMODE() detects incompatibility (4)' '
|
test_expect_success 'OPT_CMDMODE() detects incompatibility (4)' '
|
||||||
|
@ -401,7 +401,7 @@ test_expect_success 'OPT_CMDMODE() detects incompatibility (4)' '
|
||||||
test_must_be_empty output &&
|
test_must_be_empty output &&
|
||||||
test_grep "mode2" output.err &&
|
test_grep "mode2" output.err &&
|
||||||
test_grep "mode34.3" output.err &&
|
test_grep "mode34.3" output.err &&
|
||||||
test_grep "is incompatible with" output.err
|
test_grep "cannot be used together" output.err
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' '
|
test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' '
|
||||||
|
|
|
@ -6,7 +6,7 @@ test_description='git cat-file'
|
||||||
|
|
||||||
test_cmdmode_usage () {
|
test_cmdmode_usage () {
|
||||||
test_expect_code 129 "$@" 2>err &&
|
test_expect_code 129 "$@" 2>err &&
|
||||||
grep "^error:.*is incompatible with" err
|
grep "^error: .* cannot be used together" err
|
||||||
}
|
}
|
||||||
|
|
||||||
for switches in \
|
for switches in \
|
||||||
|
|
|
@ -887,7 +887,7 @@ test_expect_success '--stdin with both a successful and a conflicted merge' '
|
||||||
test_expect_success '--merge-base is incompatible with --stdin' '
|
test_expect_success '--merge-base is incompatible with --stdin' '
|
||||||
test_must_fail git merge-tree --merge-base=side1 --stdin 2>expect &&
|
test_must_fail git merge-tree --merge-base=side1 --stdin 2>expect &&
|
||||||
|
|
||||||
grep "^fatal: --merge-base is incompatible with --stdin" expect
|
grep "^fatal: .*merge-base.*stdin.* cannot be used together" expect
|
||||||
'
|
'
|
||||||
|
|
||||||
# specify merge-base as parent of branch2
|
# specify merge-base as parent of branch2
|
||||||
|
|
|
@ -64,7 +64,7 @@ test_expect_success 'disallows --bundle-uri with shallow options' '
|
||||||
for option in --depth=1 --shallow-since=01-01-2000 --shallow-exclude=HEAD
|
for option in --depth=1 --shallow-since=01-01-2000 --shallow-exclude=HEAD
|
||||||
do
|
do
|
||||||
test_must_fail git clone --bundle-uri=bundle $option from to 2>err &&
|
test_must_fail git clone --bundle-uri=bundle $option from to 2>err &&
|
||||||
grep "bundle-uri is incompatible" err || return 1
|
grep "bundle-uri.* cannot be used together" err || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue