blame: move no_whole_file_rename flag to scoreboard
authorJeff Smith <whydoubt@gmail.com>
Wed, 24 May 2017 05:15:24 +0000 (00:15 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 May 2017 06:41:51 +0000 (15:41 +0900)
The no_whole_file_rename flag is used in parts of blame that are being
moved to libgit, and should be accessible via the scoreboard structure.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/blame.c
index 8e676fb933d06ff7d2112f56cc1f3070fd47a6b5..90c643c7da671235ad51b563d93db7e5fa56b431 100644 (file)
@@ -386,6 +386,7 @@ struct blame_scoreboard {
        int reverse;
        int show_root;
        int xdl_opts;
+       int no_whole_file_rename;
 };
 
 static void sanity_check_refcnt(struct blame_scoreboard *);
@@ -1411,7 +1412,7 @@ static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin,
         * The first pass looks for unrenamed path to optimize for
         * common cases, then we look for renames in the second pass.
         */
-       for (pass = 0; pass < 2 - no_whole_file_rename; pass++) {
+       for (pass = 0; pass < 2 - sb->no_whole_file_rename; pass++) {
                struct blame_origin *(*find)(struct commit *, struct blame_origin *);
                find = pass ? find_rename : find_origin;
 
@@ -2889,6 +2890,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 
        sb.show_root = show_root;
        sb.xdl_opts = xdl_opts;
+       sb.no_whole_file_rename = no_whole_file_rename;
 
        read_mailmap(&mailmap, NULL);