merge-recursive: split internal fields into a separate struct

merge_options has several internal fields that should not be set or read
by external callers.  This just complicates the API.  Move them into an
opaque merge_options_internal struct that is defined only in
merge-recursive.c and keep these out of merge-recursive.h.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren
2019-08-17 11:41:41 -07:00
committed by Junio C Hamano
parent e95e481f9e
commit 5bf7e5779e
2 changed files with 105 additions and 97 deletions

View File

@ -1,13 +1,15 @@
#ifndef MERGE_RECURSIVE_H
#define MERGE_RECURSIVE_H
#include "string-list.h"
#include "unpack-trees.h"
#include "strbuf.h"
struct commit;
struct commit_list;
struct object_id;
struct repository;
struct tree;
struct merge_options_internal;
struct merge_options {
struct repository *repo;
@ -45,13 +47,8 @@ struct merge_options {
const char *subtree_shift;
unsigned renormalize : 1;
/* internal fields used by the implementation (do NOT set these) */
int call_depth;
int needed_rename_limit;
struct hashmap current_file_dir_set;
struct string_list df_conflict_file_set;
struct unpack_trees_options unpack_opts;
struct index_state orig_index;
/* internal fields used by the implementation */
struct merge_options_internal *priv;
};
void init_merge_options(struct merge_options *opt, struct repository *repo);