提交 5e505257 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

diff: properly error out when combining multiple pickaxe options

In f506b8e8 (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: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 15af58c1
......@@ -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
......
......@@ -251,7 +251,6 @@ void diffcore_pickaxe(struct diff_options *o)
}
}
/* Might want to warn when both S and G are on; I don't care... */
pickaxe(&diff_queued_diff, o, regexp, kws,
(opts & DIFF_PICKAXE_KIND_G) ? diff_grep : has_changes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册