summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-01-04 22:50:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-04 23:02:40 (GMT)
commit5e505257f2651647c072f9c61fdc5dd52bbce8b2 (patch)
tree57327f342244e20dbc8d1dc5f6932343eea13de4 /diff.c
parent15af58c1adba431c216e2a45fa0d22944560ba02 (diff)
downloadgit-5e505257f2651647c072f9c61fdc5dd52bbce8b2.zip
git-5e505257f2651647c072f9c61fdc5dd52bbce8b2.tar.gz
git-5e505257f2651647c072f9c61fdc5dd52bbce8b2.tar.bz2
diff: properly error out when combining multiple pickaxe options
In f506b8e8b5 (git log/diff: add -G<regexp> that greps in the patch text, 2010-08-23) we were hesitant to check if the user requests both -S and -G at the same time. Now that the pickaxe family also offers --find-object, which looks slightly more different than the former two, let's add a check that those are not used at the same time. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index a872bdc..42858d4 100644
--- a/diff.c
+++ b/diff.c
@@ -4123,6 +4123,9 @@ void diff_setup_done(struct diff_options *options)
if (count > 1)
die(_("--name-only, --name-status, --check and -s are mutually exclusive"));
+ if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))
+ die(_("-G, -S and --find-object are mutually exclusive"));
+
/*
* Most of the time we can say "there are changes"
* only by checking if there are changed paths, but