diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-11-09 14:31:27 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-09 14:31:27 +0900 |
commit | 8cc633286a4803025d84b77c808a2c7ad8616f2f (patch) | |
tree | 624047e4917cd5113dad8f487dd8dec21985c775 /diffcore-pickaxe.c | |
parent | bde13700105a1c945819578ce8d5c0627d52c741 (diff) | |
parent | 0d1e0e7801bb2ae22036ad09f9f5cec17e08c48b (diff) | |
download | git-8cc633286a4803025d84b77c808a2c7ad8616f2f.tar.gz git-8cc633286a4803025d84b77c808a2c7ad8616f2f.tar.xz |
Merge branch 'bw/diff-opt-impl-to-bitfields'
A single-word "unsigned flags" in the diff options is being split
into a structure with many bitfields.
* bw/diff-opt-impl-to-bitfields:
diff: make struct diff_flags members lowercase
diff: remove DIFF_OPT_CLR macro
diff: remove DIFF_OPT_SET macro
diff: remove DIFF_OPT_TST macro
diff: remove touched flags
diff: add flag to indicate textconv was set via cmdline
diff: convert flags to be stored in bitfields
add, reset: use DIFF_OPT_SET macro to set a diff flag
Diffstat (limited to 'diffcore-pickaxe.c')
-rw-r--r-- | diffcore-pickaxe.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index 341529b5a..9476bd210 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -131,7 +131,7 @@ static int pickaxe_match(struct diff_filepair *p, struct diff_options *o, if (!DIFF_FILE_VALID(p->one) && !DIFF_FILE_VALID(p->two)) return 0; - if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) { + if (o->flags.allow_textconv) { textconv_one = get_textconv(p->one); textconv_two = get_textconv(p->two); } @@ -222,11 +222,11 @@ void diffcore_pickaxe(struct diff_options *o) if (opts & (DIFF_PICKAXE_REGEX | DIFF_PICKAXE_KIND_G)) { int cflags = REG_EXTENDED | REG_NEWLINE; - if (DIFF_OPT_TST(o, PICKAXE_IGNORE_CASE)) + if (o->flags.pickaxe_ignore_case) cflags |= REG_ICASE; regcomp_or_die(®ex, needle, cflags); regexp = ®ex; - } else if (DIFF_OPT_TST(o, PICKAXE_IGNORE_CASE) && + } else if (o->flags.pickaxe_ignore_case && has_non_ascii(needle)) { struct strbuf sb = STRBUF_INIT; int cflags = REG_NEWLINE | REG_ICASE; @@ -236,7 +236,7 @@ void diffcore_pickaxe(struct diff_options *o) strbuf_release(&sb); regexp = ®ex; } else { - kws = kwsalloc(DIFF_OPT_TST(o, PICKAXE_IGNORE_CASE) + kws = kwsalloc(o->flags.pickaxe_ignore_case ? tolower_trans_tbl : NULL); kwsincr(kws, needle, strlen(needle)); kwsprep(kws); |