mirror of
https://github.com/git/git.git
synced 2024-05-18 22:56:07 +02:00
merge-ll: introduce LL_MERGE_OPTIONS_INIT
Introduce a macro to initialize `struct ll_merge_options` in preparation for the next commit that will add a new member that needs to be initialized to a non-zero value. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7457014be5
commit
412aff7b33
|
@ -262,7 +262,7 @@ static int checkout_merged(int pos, const struct checkout *state,
|
||||||
mmbuffer_t result_buf;
|
mmbuffer_t result_buf;
|
||||||
struct object_id threeway[3];
|
struct object_id threeway[3];
|
||||||
unsigned mode = 0;
|
unsigned mode = 0;
|
||||||
struct ll_merge_options ll_opts;
|
struct ll_merge_options ll_opts = LL_MERGE_OPTIONS_INIT;
|
||||||
int renormalize = 0;
|
int renormalize = 0;
|
||||||
|
|
||||||
memset(threeway, 0, sizeof(threeway));
|
memset(threeway, 0, sizeof(threeway));
|
||||||
|
@ -284,7 +284,6 @@ static int checkout_merged(int pos, const struct checkout *state,
|
||||||
read_mmblob(&ours, &threeway[1]);
|
read_mmblob(&ours, &threeway[1]);
|
||||||
read_mmblob(&theirs, &threeway[2]);
|
read_mmblob(&theirs, &threeway[2]);
|
||||||
|
|
||||||
memset(&ll_opts, 0, sizeof(ll_opts));
|
|
||||||
git_config_get_bool("merge.renormalize", &renormalize);
|
git_config_get_bool("merge.renormalize", &renormalize);
|
||||||
ll_opts.renormalize = renormalize;
|
ll_opts.renormalize = renormalize;
|
||||||
merge_status = ll_merge(&result_buf, path, &ancestor, "base",
|
merge_status = ll_merge(&result_buf, path, &ancestor, "base",
|
||||||
|
|
|
@ -401,7 +401,7 @@ enum ll_merge_result ll_merge(mmbuffer_t *result_buf,
|
||||||
const struct ll_merge_options *opts)
|
const struct ll_merge_options *opts)
|
||||||
{
|
{
|
||||||
struct attr_check *check = load_merge_attributes();
|
struct attr_check *check = load_merge_attributes();
|
||||||
static const struct ll_merge_options default_opts;
|
static const struct ll_merge_options default_opts = LL_MERGE_OPTIONS_INIT;
|
||||||
const char *ll_driver_name = NULL;
|
const char *ll_driver_name = NULL;
|
||||||
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
|
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
|
||||||
const struct ll_merge_driver *driver;
|
const struct ll_merge_driver *driver;
|
||||||
|
|
|
@ -82,6 +82,8 @@ struct ll_merge_options {
|
||||||
long xdl_opts;
|
long xdl_opts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define LL_MERGE_OPTIONS_INIT {0}
|
||||||
|
|
||||||
enum ll_merge_result {
|
enum ll_merge_result {
|
||||||
LL_MERGE_ERROR = -1,
|
LL_MERGE_ERROR = -1,
|
||||||
LL_MERGE_OK = 0,
|
LL_MERGE_OK = 0,
|
||||||
|
|
|
@ -1956,7 +1956,7 @@ static int merge_3way(struct merge_options *opt,
|
||||||
mmbuffer_t *result_buf)
|
mmbuffer_t *result_buf)
|
||||||
{
|
{
|
||||||
mmfile_t orig, src1, src2;
|
mmfile_t orig, src1, src2;
|
||||||
struct ll_merge_options ll_opts = {0};
|
struct ll_merge_options ll_opts = LL_MERGE_OPTIONS_INIT;
|
||||||
char *base, *name1, *name2;
|
char *base, *name1, *name2;
|
||||||
enum ll_merge_result merge_status;
|
enum ll_merge_result merge_status;
|
||||||
|
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ static int merge_3way(struct merge_options *opt,
|
||||||
const int extra_marker_size)
|
const int extra_marker_size)
|
||||||
{
|
{
|
||||||
mmfile_t orig, src1, src2;
|
mmfile_t orig, src1, src2;
|
||||||
struct ll_merge_options ll_opts = {0};
|
struct ll_merge_options ll_opts = LL_MERGE_OPTIONS_INIT;
|
||||||
char *base, *name1, *name2;
|
char *base, *name1, *name2;
|
||||||
enum ll_merge_result merge_status;
|
enum ll_merge_result merge_status;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue