]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/blame.c
merge-recursive: fix rename/rename(1to2) for working tree with a binary
[thirdparty/git.git] / builtin / blame.c
index bf1cecdf3f9ebbbd9a42381566c7ca2d86355e0d..94ef57c1cc304963452772e24125e5939dff0481 100644 (file)
@@ -864,8 +864,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
                OPT_BIT(0, "minimal", &xdl_opts, N_("Spend extra cycles to find better match"), XDF_NEED_MINIMAL),
                OPT_STRING('S', NULL, &revs_file, N_("file"), N_("Use revisions from <file> instead of calling git-rev-list")),
                OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use <file>'s contents as the final image")),
-               { OPTION_CALLBACK, 'C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback },
-               { OPTION_CALLBACK, 'M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback },
+               OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback),
+               OPT_CALLBACK_F('M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback),
                OPT_STRING_LIST('L', NULL, &range_list, N_("n,m"), N_("Process only line range n,m, counting from 1")),
                OPT__ABBREV(&abbrev),
                OPT_END()
@@ -1061,6 +1061,14 @@ parse_done:
        string_list_clear(&ignore_revs_file_list, 0);
        string_list_clear(&ignore_rev_list, 0);
        setup_scoreboard(&sb, path, &o);
+
+       /*
+        * Changed-path Bloom filters are disabled when looking
+        * for copies.
+        */
+       if (!(opt & PICKAXE_BLAME_COPY))
+               setup_blame_bloom_data(&sb, path);
+
        lno = sb.num_lines;
 
        if (lno && !range_list.nr)
@@ -1164,5 +1172,7 @@ parse_done:
                printf("num get patch: %d\n", sb.num_get_patch);
                printf("num commits: %d\n", sb.num_commits);
        }
+
+       cleanup_scoreboard(&sb);
        return 0;
 }