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:
Jonathan Tan
2020-04-07 15:11:41 -07:00
committed by Junio C Hamano
parent db7ed7418b
commit 1c37e86ab2
5 changed files with 54 additions and 32 deletions

View File

@ -65,9 +65,12 @@ void free_filespec(struct diff_filespec *);
void fill_filespec(struct diff_filespec *, const struct object_id *,
int, unsigned short);
#define CHECK_SIZE_ONLY 1
#define CHECK_BINARY 2
int diff_populate_filespec(struct repository *, struct diff_filespec *, unsigned int);
struct diff_populate_filespec_options {
unsigned check_size_only : 1;
unsigned check_binary : 1;
};
int diff_populate_filespec(struct repository *, struct diff_filespec *,
const struct diff_populate_filespec_options *);
void diff_free_filespec_data(struct diff_filespec *);
void diff_free_filespec_blob(struct diff_filespec *);
int diff_filespec_is_binary(struct repository *, struct diff_filespec *);