blame: move xdl_opts flags to scoreboard

The xdl_opts flags are 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>

Jeff Smith committed May 24, 2017 at 00:15 UTC 73e1c299e55df4d6e577c3950fc6d53a8ec2cbef
1 file changed +5 -3
builtin/blame.c
+5 -3
@@ -125,7 +125,7 @@ struct progress_info {
125 };
126
127 static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b,
128 - xdl_emit_hunk_consume_func_t hunk_func, void *cb_data)
128 + xdl_emit_hunk_consume_func_t hunk_func, void *cb_data, int xdl_opts)
129 {
130 xpparam_t xpp = {0};
131 xdemitconf_t xecfg = {0};
@@ -385,6 +385,7 @@ struct blame_scoreboard {
385 /* flags */
386 int reverse;
387 int show_root;
388 + int xdl_opts;
389 };
390
391 static void sanity_check_refcnt(struct blame_scoreboard *);
@@ -948,7 +949,7 @@ static void pass_blame_to_parent(struct blame_scoreboard *sb,
949 fill_origin_blob(&sb->revs->diffopt, target, &file_o, &sb->num_read_blob);
950 sb->num_get_patch++;
951
951 - if (diff_hunks(&file_p, &file_o, blame_chunk_cb, &d))
952 + if (diff_hunks(&file_p, &file_o, blame_chunk_cb, &d, sb->xdl_opts))
953 die("unable to generate diff (%s -> %s)",
954 oid_to_hex(&parent->commit->object.oid),
955 oid_to_hex(&target->commit->object.oid));
@@ -1097,7 +1098,7 @@ static void find_copy_in_blob(struct blame_scoreboard *sb,
1098 * file_p partially may match that image.
1099 */
1100 memset(split, 0, sizeof(struct blame_entry [3]));
1100 - if (diff_hunks(file_p, &file_o, handle_split_cb, &d))
1101 + if (diff_hunks(file_p, &file_o, handle_split_cb, &d, sb->xdl_opts))
1102 die("unable to generate diff (%s)",
1103 oid_to_hex(&parent->commit->object.oid));
1104 /* remainder, if any, all match the preimage */
@@ -2887,6 +2888,7 @@ parse_done:
2888 sb.copy_score = blame_copy_score;
2889
2890 sb.show_root = show_root;
2891 + sb.xdl_opts = xdl_opts;
2892
2893 read_mailmap(&mailmap, NULL);
2894