trailer: put process_trailers() options into a struct

We already have two options and are about to add a few more.
To avoid having a huge number of boolean arguments, let's
convert to an options struct which can be passed in.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2017-08-10 14:03:58 -04:00
committed by Junio C Hamano
parent cf8899d285
commit 8abc89800c
3 changed files with 21 additions and 12 deletions

View File

@@ -22,7 +22,15 @@ struct trailer_info {
size_t trailer_nr;
};
void process_trailers(const char *file, int in_place, int trim_empty,
struct process_trailer_options {
int in_place;
int trim_empty;
};
#define PROCESS_TRAILER_OPTIONS_INIT {0}
void process_trailers(const char *file,
const struct process_trailer_options *opts,
struct string_list *trailers);
void trailer_info_get(struct trailer_info *info, const char *str);