On some platforms, certain headers need to be included before regex.h
[git.git] / diff.c
diff --git a/diff.c b/diff.c
index 5eae094..2db2cc5 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -267,6 +267,7 @@ static void builtin_diff(const char *name_a,
                ecbdata.label_path = lbl;
                xpp.flags = XDF_NEED_MINIMAL;
                xecfg.ctxlen = 3;
+               xecfg.flags = XDL_EMIT_FUNCNAMES;
                if (!diffopts)
                        ;
                else if (!strncmp(diffopts, "--unified=", 10))
@@ -299,7 +300,7 @@ void fill_filespec(struct diff_filespec *spec, const unsigned char *sha1,
                   unsigned short mode)
 {
        if (mode) {
-               spec->mode = DIFF_FILE_CANON_MODE(mode);
+               spec->mode = canon_mode(mode);
                memcpy(spec->sha1, sha1, 20);
                spec->sha1_valid = !!memcmp(sha1, null_sha1, 20);
        }
@@ -882,6 +883,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
                options->filter = arg + 14;
        else if (!strcmp(arg, "--pickaxe-all"))
                options->pickaxe_opts = DIFF_PICKAXE_ALL;
+       else if (!strcmp(arg, "--pickaxe-regex"))
+               options->pickaxe_opts = DIFF_PICKAXE_REGEX;
        else if (!strncmp(arg, "-B", 2)) {
                if ((options->break_opt =
                     diff_scoreopt_parse(arg)) == -1)