diff: make diff_populate_filespec_options struct
The behavior of diff_populate_filespec() currently can be customized through a bitflag, but a subsequent patch requires it to support a non-boolean option. Replace the bitflag with an options struct. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
db7ed7418b
commit
1c37e86ab2
@ -519,7 +519,7 @@ static void fill_line_ends(struct repository *r,
|
||||
unsigned long *ends = NULL;
|
||||
char *data = NULL;
|
||||
|
||||
if (diff_populate_filespec(r, spec, 0))
|
||||
if (diff_populate_filespec(r, spec, NULL))
|
||||
die("Cannot read blob %s", oid_to_hex(&spec->oid));
|
||||
|
||||
ALLOC_ARRAY(ends, size);
|
||||
@ -1045,12 +1045,12 @@ static int process_diff_filepair(struct rev_info *rev,
|
||||
return 0;
|
||||
|
||||
assert(pair->two->oid_valid);
|
||||
diff_populate_filespec(rev->diffopt.repo, pair->two, 0);
|
||||
diff_populate_filespec(rev->diffopt.repo, pair->two, NULL);
|
||||
file_target.ptr = pair->two->data;
|
||||
file_target.size = pair->two->size;
|
||||
|
||||
if (pair->one->oid_valid) {
|
||||
diff_populate_filespec(rev->diffopt.repo, pair->one, 0);
|
||||
diff_populate_filespec(rev->diffopt.repo, pair->one, NULL);
|
||||
file_parent.ptr = pair->one->data;
|
||||
file_parent.size = pair->one->size;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user