Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Noël Avila <jn.avila@free.fr>2022-02-01 01:07:46 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-05 00:58:28 +0300
commita699367bb8749a338aefb092c5d7ac75c69d61e1 (patch)
treec09bbd28e122a8a2b718fed0c41fbecd743ad8cf /builtin/grep.c
parent5d01301f2b865aa8dba1654d3f447ce9d21db0b5 (diff)
i18n: factorize more 'incompatible options' messages
Find more incompatible options to factorize. When more than two options are mutually exclusive, print the ones which are actually on the command line. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 9e34a820ad..88144f0630 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1167,11 +1167,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
if (!show_in_pager && !opt.status_only)
setup_pager();
- if (!use_index && (untracked || cached))
- die(_("--cached or --untracked cannot be used with --no-index"));
-
- if (untracked && cached)
- die(_("--untracked cannot be used with --cached"));
+ die_for_incompatible_opt3(!use_index, "--no-index",
+ untracked, "--untracked",
+ cached, "--cached");
if (!use_index || untracked) {
int use_exclude = (opt_exclude < 0) ? use_index : !!opt_exclude;