From 1c37e86ab2834dfca311799e799568794bc474ce Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Tue, 7 Apr 2020 15:11:41 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- diffcore.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index 7c07347e42..3b2020ce93 100644 --- a/diffcore.h +++ b/diffcore.h @@ -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 *); -- cgit v1.2.3