Skip to content

Commit 73e1c29

Browse files
whydoubtgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2cf8337 commit 73e1c29

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

builtin/blame.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct progress_info {
125125
};
126126

127127
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)
129129
{
130130
xpparam_t xpp = {0};
131131
xdemitconf_t xecfg = {0};
@@ -385,6 +385,7 @@ struct blame_scoreboard {
385385
/* flags */
386386
int reverse;
387387
int show_root;
388+
int xdl_opts;
388389
};
389390

390391
static void sanity_check_refcnt(struct blame_scoreboard *);
@@ -948,7 +949,7 @@ static void pass_blame_to_parent(struct blame_scoreboard *sb,
948949
fill_origin_blob(&sb->revs->diffopt, target, &file_o, &sb->num_read_blob);
949950
sb->num_get_patch++;
950951

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))
952953
die("unable to generate diff (%s -> %s)",
953954
oid_to_hex(&parent->commit->object.oid),
954955
oid_to_hex(&target->commit->object.oid));
@@ -1097,7 +1098,7 @@ static void find_copy_in_blob(struct blame_scoreboard *sb,
10971098
* file_p partially may match that image.
10981099
*/
10991100
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))
11011102
die("unable to generate diff (%s)",
11021103
oid_to_hex(&parent->commit->object.oid));
11031104
/* remainder, if any, all match the preimage */
@@ -2887,6 +2888,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
28872888
sb.copy_score = blame_copy_score;
28882889

28892890
sb.show_root = show_root;
2891+
sb.xdl_opts = xdl_opts;
28902892

28912893
read_mailmap(&mailmap, NULL);
28922894

0 commit comments

Comments
 (0)