diff options
-rw-r--r-- | diff.c | 3 | ||||
-rw-r--r-- | diff.h | 2 | ||||
-rwxr-xr-x | t/t4209-log-pickaxe.sh | 5 |
3 files changed, 10 insertions, 0 deletions
@@ -4628,6 +4628,9 @@ void diff_setup_done(struct diff_options *options) if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK)) die(_("-G, -S and --find-object are mutually exclusive")); + if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK)) + die(_("-G and --pickaxe-regex are mutually exclusive, use --pickaxe-regex with -S")); + /* * Most of the time we can say "there are changes" * only by checking if there are changed paths, but @@ -556,6 +556,8 @@ int git_config_rename(const char *var, const char *value); #define DIFF_PICKAXE_KINDS_MASK (DIFF_PICKAXE_KIND_S | \ DIFF_PICKAXE_KIND_G | \ DIFF_PICKAXE_KIND_OBJFIND) +#define DIFF_PICKAXE_KINDS_G_REGEX_MASK (DIFF_PICKAXE_KIND_G | \ + DIFF_PICKAXE_REGEX) #define DIFF_PICKAXE_IGNORE_CASE 32 diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index 532bb875f0..772c6c1a7c 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -66,6 +66,11 @@ test_expect_success 'usage' ' grep "mutually exclusive" err ' +test_expect_success 'usage: --pickaxe-regex' ' + test_expect_code 128 git log -Gregex --pickaxe-regex 2>err && + grep "mutually exclusive" err +' + test_expect_success 'usage: --no-pickaxe-regex' ' cat >expect <<-\EOF && fatal: unrecognized argument: --no-pickaxe-regex |