mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 13:48:41 +00:00
Update git_merge_tree_opts to git_merge_options
This commit is contained in:
parent
02105a27f0
commit
5aa2ac6de1
@ -216,22 +216,22 @@ typedef struct {
|
||||
|
||||
/** Flags for handling conflicting content. */
|
||||
git_merge_file_favor_t file_favor;
|
||||
} git_merge_tree_opts;
|
||||
} git_merge_options;
|
||||
|
||||
#define GIT_MERGE_TREE_OPTS_VERSION 1
|
||||
#define GIT_MERGE_TREE_OPTS_INIT {GIT_MERGE_TREE_OPTS_VERSION}
|
||||
#define GIT_MERGE_OPTIONS_VERSION 1
|
||||
#define GIT_MERGE_OPTIONS_INIT {GIT_MERGE_OPTIONS_VERSION}
|
||||
|
||||
/**
|
||||
* Initializes a `git_merge_tree_opts` with default values. Equivalent to
|
||||
* creating an instance with GIT_MERGE_TREE_OPTS_INIT.
|
||||
* Initializes a `git_merge_options` with default values. Equivalent to
|
||||
* creating an instance with GIT_MERGE_OPTIONS_INIT.
|
||||
*
|
||||
* @param opts the `git_merge_tree_opts` instance to initialize.
|
||||
* @param opts the `git_merge_options` instance to initialize.
|
||||
* @param version the version of the struct; you should pass
|
||||
* `GIT_MERGE_TREE_OPTS_VERSION` here.
|
||||
* `GIT_MERGE_OPTIONS_VERSION` here.
|
||||
* @return Zero on success; -1 on failure.
|
||||
*/
|
||||
GIT_EXTERN(int) git_merge_tree_init_opts(
|
||||
git_merge_tree_opts* opts,
|
||||
GIT_EXTERN(int) git_merge_init_options(
|
||||
git_merge_options *opts,
|
||||
int version);
|
||||
|
||||
/**
|
||||
@ -447,7 +447,7 @@ GIT_EXTERN(int) git_merge_trees(
|
||||
const git_tree *ancestor_tree,
|
||||
const git_tree *our_tree,
|
||||
const git_tree *their_tree,
|
||||
const git_merge_tree_opts *opts);
|
||||
const git_merge_options *opts);
|
||||
|
||||
/**
|
||||
* Merge two commits, producing a `git_index` that reflects the result of
|
||||
@ -469,7 +469,7 @@ GIT_EXTERN(int) git_merge_commits(
|
||||
git_repository *repo,
|
||||
const git_commit *our_commit,
|
||||
const git_commit *their_commit,
|
||||
const git_merge_tree_opts *opts);
|
||||
const git_merge_options *opts);
|
||||
|
||||
/**
|
||||
* Merges the given commit(s) into HEAD and either returns immediately
|
||||
@ -496,7 +496,7 @@ GIT_EXTERN(int) git_merge_commits(
|
||||
* @param repo the repository to merge
|
||||
* @param merge_heads the heads to merge into
|
||||
* @param merge_heads_len the number of heads to merge
|
||||
* @param checkout_opts merge options
|
||||
* @param merge_opts merge options
|
||||
* @param checkout_opts checkout options
|
||||
* @return 0 on success or error code
|
||||
*/
|
||||
@ -505,7 +505,7 @@ GIT_EXTERN(int) git_merge(
|
||||
git_repository *repo,
|
||||
const git_merge_head **their_heads,
|
||||
size_t their_heads_len,
|
||||
const git_merge_tree_opts *merge_opts,
|
||||
const git_merge_options *merge_opts,
|
||||
const git_checkout_options *checkout_opts);
|
||||
|
||||
/**
|
||||
|
@ -26,12 +26,12 @@ typedef struct {
|
||||
/** For merge commits, the "mainline" is treated as the parent. */
|
||||
unsigned int mainline;
|
||||
|
||||
git_merge_tree_opts merge_tree_opts;
|
||||
git_merge_options merge_opts;
|
||||
git_checkout_options checkout_opts;
|
||||
} git_revert_options;
|
||||
|
||||
#define GIT_REVERT_OPTIONS_VERSION 1
|
||||
#define GIT_REVERT_OPTIONS_INIT {GIT_REVERT_OPTIONS_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
|
||||
#define GIT_REVERT_OPTIONS_INIT {GIT_REVERT_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
|
||||
|
||||
/**
|
||||
* Initializes a `git_revert_options` with default values. Equivalent to
|
||||
@ -66,7 +66,7 @@ int git_revert_commit(
|
||||
git_commit *revert_commit,
|
||||
git_commit *our_commit,
|
||||
unsigned int mainline,
|
||||
const git_merge_tree_opts *merge_tree_opts);
|
||||
const git_merge_options *merge_options);
|
||||
|
||||
/**
|
||||
* Reverts the given commit, producing changes in the working directory.
|
||||
|
48
src/merge.c
48
src/merge.c
@ -664,7 +664,7 @@ static int index_entry_similarity_exact(
|
||||
git_index_entry *b,
|
||||
size_t b_idx,
|
||||
void **cache,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
GIT_UNUSED(repo);
|
||||
GIT_UNUSED(a_idx);
|
||||
@ -682,7 +682,7 @@ static int index_entry_similarity_calc(
|
||||
void **out,
|
||||
git_repository *repo,
|
||||
git_index_entry *entry,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
git_blob *blob;
|
||||
git_diff_file diff_file = {{{0}}};
|
||||
@ -722,7 +722,7 @@ static int index_entry_similarity_inexact(
|
||||
git_index_entry *b,
|
||||
size_t b_idx,
|
||||
void **cache,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
int score = 0;
|
||||
int error = 0;
|
||||
@ -759,9 +759,9 @@ static int merge_diff_mark_similarity(
|
||||
git_merge_diff_list *diff_list,
|
||||
struct merge_diff_similarity *similarity_ours,
|
||||
struct merge_diff_similarity *similarity_theirs,
|
||||
int (*similarity_fn)(git_repository *, git_index_entry *, size_t, git_index_entry *, size_t, void **, const git_merge_tree_opts *),
|
||||
int (*similarity_fn)(git_repository *, git_index_entry *, size_t, git_index_entry *, size_t, void **, const git_merge_options *),
|
||||
void **cache,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
size_t i, j;
|
||||
git_merge_diff *conflict_src, *conflict_tgt;
|
||||
@ -862,7 +862,7 @@ static void merge_diff_mark_rename_conflict(
|
||||
bool theirs_renamed,
|
||||
size_t theirs_source_idx,
|
||||
git_merge_diff *target,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
git_merge_diff *ours_source = NULL, *theirs_source = NULL;
|
||||
|
||||
@ -932,7 +932,7 @@ static void merge_diff_list_coalesce_renames(
|
||||
git_merge_diff_list *diff_list,
|
||||
struct merge_diff_similarity *similarity_ours,
|
||||
struct merge_diff_similarity *similarity_theirs,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
size_t i;
|
||||
bool ours_renamed = 0, theirs_renamed = 0;
|
||||
@ -1022,7 +1022,7 @@ static void merge_diff_list_count_candidates(
|
||||
int git_merge_diff_list__find_renames(
|
||||
git_repository *repo,
|
||||
git_merge_diff_list *diff_list,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
struct merge_diff_similarity *similarity_ours, *similarity_theirs;
|
||||
void **cache = NULL;
|
||||
@ -1450,10 +1450,10 @@ void git_merge_diff_list__free(git_merge_diff_list *diff_list)
|
||||
git__free(diff_list);
|
||||
}
|
||||
|
||||
static int merge_tree_normalize_opts(
|
||||
static int merge_normalize_opts(
|
||||
git_repository *repo,
|
||||
git_merge_tree_opts *opts,
|
||||
const git_merge_tree_opts *given)
|
||||
git_merge_options *opts,
|
||||
const git_merge_options *given)
|
||||
{
|
||||
git_config *cfg = NULL;
|
||||
int error = 0;
|
||||
@ -1464,9 +1464,9 @@ static int merge_tree_normalize_opts(
|
||||
return error;
|
||||
|
||||
if (given != NULL)
|
||||
memcpy(opts, given, sizeof(git_merge_tree_opts));
|
||||
memcpy(opts, given, sizeof(git_merge_options));
|
||||
else {
|
||||
git_merge_tree_opts init = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options init = GIT_MERGE_OPTIONS_INIT;
|
||||
memcpy(opts, &init, sizeof(init));
|
||||
|
||||
opts->flags = GIT_MERGE_TREE_FIND_RENAMES;
|
||||
@ -1634,10 +1634,10 @@ int git_merge_trees(
|
||||
const git_tree *ancestor_tree,
|
||||
const git_tree *our_tree,
|
||||
const git_tree *their_tree,
|
||||
const git_merge_tree_opts *given_opts)
|
||||
const git_merge_options *given_opts)
|
||||
{
|
||||
git_merge_diff_list *diff_list;
|
||||
git_merge_tree_opts opts;
|
||||
git_merge_options opts;
|
||||
git_merge_diff *conflict;
|
||||
git_vector changes;
|
||||
size_t i;
|
||||
@ -1647,9 +1647,9 @@ int git_merge_trees(
|
||||
|
||||
*out = NULL;
|
||||
|
||||
GITERR_CHECK_VERSION(given_opts, GIT_MERGE_TREE_OPTS_VERSION, "git_merge_tree_opts");
|
||||
GITERR_CHECK_VERSION(given_opts, GIT_MERGE_OPTIONS_VERSION, "git_merge_options");
|
||||
|
||||
if ((error = merge_tree_normalize_opts(repo, &opts, given_opts)) < 0)
|
||||
if ((error = merge_normalize_opts(repo, &opts, given_opts)) < 0)
|
||||
return error;
|
||||
|
||||
diff_list = git_merge_diff_list__alloc(repo);
|
||||
@ -1688,7 +1688,7 @@ int git_merge_commits(
|
||||
git_repository *repo,
|
||||
const git_commit *our_commit,
|
||||
const git_commit *their_commit,
|
||||
const git_merge_tree_opts *opts)
|
||||
const git_merge_options *opts)
|
||||
{
|
||||
git_oid ancestor_oid;
|
||||
git_commit *ancestor_commit = NULL;
|
||||
@ -2552,7 +2552,7 @@ int git_merge(
|
||||
git_repository *repo,
|
||||
const git_merge_head **their_heads,
|
||||
size_t their_heads_len,
|
||||
const git_merge_tree_opts *merge_opts,
|
||||
const git_merge_options *merge_opts,
|
||||
const git_checkout_options *given_checkout_opts)
|
||||
{
|
||||
git_merge_result *result;
|
||||
@ -2779,14 +2779,14 @@ void git_merge_head_free(git_merge_head *head)
|
||||
git__free(head);
|
||||
}
|
||||
|
||||
int git_merge_tree_init_opts(git_merge_tree_opts* opts, int version)
|
||||
int git_merge_init_options(git_merge_options *opts, int version)
|
||||
{
|
||||
if (version != GIT_MERGE_TREE_OPTS_VERSION) {
|
||||
giterr_set(GITERR_INVALID, "Invalid version %d for git_merge_tree_opts", version);
|
||||
if (version != GIT_MERGE_OPTIONS_VERSION) {
|
||||
giterr_set(GITERR_INVALID, "Invalid version %d for git_merge_options", version);
|
||||
return -1;
|
||||
} else {
|
||||
git_merge_tree_opts o = GIT_MERGE_TREE_OPTS_INIT;
|
||||
memcpy(opts, &o, sizeof(o));
|
||||
git_merge_options default_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
memcpy(opts, &default_opts, sizeof(git_merge_options));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ int git_merge_diff_list__find_differences(git_merge_diff_list *merge_diff_list,
|
||||
const git_tree *ours_tree,
|
||||
const git_tree *theirs_tree);
|
||||
|
||||
int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list *merge_diff_list, const git_merge_tree_opts *opts);
|
||||
int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list *merge_diff_list, const git_merge_options *opts);
|
||||
|
||||
void git_merge_diff_list__free(git_merge_diff_list *diff_list);
|
||||
|
||||
|
@ -121,7 +121,7 @@ int git_revert_commit(
|
||||
git_commit *revert_commit,
|
||||
git_commit *our_commit,
|
||||
unsigned int mainline,
|
||||
const git_merge_tree_opts *merge_tree_opts)
|
||||
const git_merge_options *merge_opts)
|
||||
{
|
||||
git_commit *parent_commit = NULL;
|
||||
git_tree *parent_tree = NULL, *our_tree = NULL, *revert_tree = NULL;
|
||||
@ -152,7 +152,7 @@ int git_revert_commit(
|
||||
(error = git_commit_tree(&our_tree, our_commit)) < 0)
|
||||
goto done;
|
||||
|
||||
error = git_merge_trees(out, repo, revert_tree, our_tree, parent_tree, merge_tree_opts);
|
||||
error = git_merge_trees(out, repo, revert_tree, our_tree, parent_tree, merge_opts);
|
||||
|
||||
done:
|
||||
git_tree_free(parent_tree);
|
||||
@ -198,7 +198,7 @@ int git_revert(
|
||||
(error = write_merge_msg(repo, commit_oidstr, commit_msg)) < 0 ||
|
||||
(error = git_repository_head(&our_ref, repo)) < 0 ||
|
||||
(error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 ||
|
||||
(error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_tree_opts)) < 0 ||
|
||||
(error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 ||
|
||||
(error = git_merge__indexes(repo, index_new)) < 0 ||
|
||||
(error = git_repository_index(&index_repo, repo)) < 0 ||
|
||||
(error = git_checkout_index(repo, index_repo, &opts.checkout_opts)) < 0)
|
||||
|
@ -10,7 +10,7 @@
|
||||
int merge_trees_from_branches(
|
||||
git_index **index, git_repository *repo,
|
||||
const char *ours_name, const char *theirs_name,
|
||||
git_merge_tree_opts *opts)
|
||||
git_merge_options *opts)
|
||||
{
|
||||
git_commit *our_commit, *their_commit, *ancestor_commit = NULL;
|
||||
git_tree *our_tree, *their_tree, *ancestor_tree = NULL;
|
||||
@ -55,7 +55,7 @@ int merge_trees_from_branches(
|
||||
int merge_commits_from_branches(
|
||||
git_index **index, git_repository *repo,
|
||||
const char *ours_name, const char *theirs_name,
|
||||
git_merge_tree_opts *opts)
|
||||
git_merge_options *opts)
|
||||
{
|
||||
git_commit *our_commit, *their_commit;
|
||||
git_oid our_oid, their_oid;
|
||||
@ -81,7 +81,7 @@ int merge_commits_from_branches(
|
||||
|
||||
int merge_branches(git_merge_result **result, git_repository *repo,
|
||||
const char *ours_branch, const char *theirs_branch,
|
||||
git_merge_tree_opts *merge_opts, git_checkout_options *checkout_opts)
|
||||
git_merge_options *merge_opts, git_checkout_options *checkout_opts)
|
||||
{
|
||||
git_reference *head_ref, *theirs_ref;
|
||||
git_merge_head *theirs_head;
|
||||
|
@ -85,16 +85,16 @@ struct merge_index_conflict_data {
|
||||
int merge_trees_from_branches(
|
||||
git_index **index, git_repository *repo,
|
||||
const char *ours_name, const char *theirs_name,
|
||||
git_merge_tree_opts *opts);
|
||||
git_merge_options *opts);
|
||||
|
||||
int merge_commits_from_branches(
|
||||
git_index **index, git_repository *repo,
|
||||
const char *ours_name, const char *theirs_name,
|
||||
git_merge_tree_opts *opts);
|
||||
git_merge_options *opts);
|
||||
|
||||
int merge_branches(git_merge_result **result, git_repository *repo,
|
||||
const char *ours_branch, const char *theirs_branch,
|
||||
git_merge_tree_opts *merge_opts, git_checkout_options *checkout_opts);
|
||||
git_merge_options *merge_opts, git_checkout_options *checkout_opts);
|
||||
|
||||
int merge_test_diff_list(git_merge_diff_list *diff_list, const struct merge_index_entry expected[], size_t expected_len);
|
||||
|
||||
|
@ -69,7 +69,7 @@ void test_merge_trees_automerge__automerge(void)
|
||||
{
|
||||
git_index *index;
|
||||
const git_index_entry *entry;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
git_blob *blob;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
@ -109,7 +109,7 @@ void test_merge_trees_automerge__automerge(void)
|
||||
void test_merge_trees_automerge__favor_ours(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
ADDED_IN_MASTER_INDEX_ENTRY,
|
||||
@ -140,7 +140,7 @@ void test_merge_trees_automerge__favor_ours(void)
|
||||
void test_merge_trees_automerge__favor_theirs(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
ADDED_IN_MASTER_INDEX_ENTRY,
|
||||
@ -171,7 +171,7 @@ void test_merge_trees_automerge__favor_theirs(void)
|
||||
void test_merge_trees_automerge__unrelated(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
|
||||
|
@ -22,7 +22,7 @@ void test_merge_trees_commits__automerge(void)
|
||||
{
|
||||
git_index *index;
|
||||
const git_index_entry *entry;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
git_blob *blob;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
@ -71,7 +71,7 @@ void test_merge_trees_commits__automerge(void)
|
||||
void test_merge_trees_commits__no_ancestor(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
|
||||
@ -98,7 +98,7 @@ void test_merge_trees_commits__no_ancestor(void)
|
||||
void test_merge_trees_commits__df_conflict(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "49130a28ef567af9a6a6104c38773fedfa5f9742", 2, "dir-10" },
|
||||
|
@ -27,7 +27,7 @@ void test_merge_trees_renames__cleanup(void)
|
||||
void test_merge_trees_renames__index(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts *opts = NULL;
|
||||
git_merge_options *opts = NULL;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
|
||||
@ -205,7 +205,7 @@ void test_merge_trees_renames__index(void)
|
||||
void test_merge_trees_renames__no_rename_index(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
|
||||
|
@ -44,7 +44,7 @@ static void test_find_differences(
|
||||
git_oid ancestor_oid, ours_oid, theirs_oid;
|
||||
git_tree *ancestor_tree, *ours_tree, *theirs_tree;
|
||||
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
|
||||
opts.target_limit = 1000;
|
||||
opts.rename_threshold = 50;
|
||||
|
@ -31,7 +31,7 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
|
||||
git_tree *our_tree, *their_tree, *ancestor_tree;
|
||||
git_oid our_oid, their_oid, ancestor_oid;
|
||||
git_buf branch_buf = GIT_BUF_INIT;
|
||||
git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours);
|
||||
cl_git_pass(git_reference_name_to_id(&our_oid, repo, branch_buf.ptr));
|
||||
|
@ -90,7 +90,7 @@ static int merge_branch(git_merge_result **result, int merge_file_favor, int che
|
||||
{
|
||||
git_oid their_oids[1];
|
||||
git_merge_head *their_heads[1];
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
|
||||
int error;
|
||||
|
||||
|
@ -35,7 +35,7 @@ void test_merge_workdir_renames__cleanup(void)
|
||||
void test_merge_workdir_renames__renames(void)
|
||||
{
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
|
||||
@ -77,7 +77,7 @@ void test_merge_workdir_renames__ours(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
@ -119,7 +119,7 @@ void test_merge_workdir_renames__ours(void)
|
||||
void test_merge_workdir_renames__similar(void)
|
||||
{
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
/*
|
||||
* Note: this differs slightly from the core git merge result - there, 4a is
|
||||
|
@ -97,7 +97,7 @@ static git_merge_result *merge_simple_branch(int merge_file_favor, int checkout_
|
||||
git_oid their_oids[1];
|
||||
git_merge_head *their_heads[1];
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
|
||||
|
||||
cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_SIMPLE_OID));
|
||||
@ -523,7 +523,7 @@ void test_merge_workdir_simple__directory_file(void)
|
||||
git_oid their_oids[1], head_commit_id;
|
||||
git_merge_head *their_heads[1];
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
git_commit *head_commit;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
@ -573,7 +573,7 @@ void test_merge_workdir_simple__unrelated(void)
|
||||
git_oid their_oids[1];
|
||||
git_merge_head *their_heads[1];
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
|
||||
@ -604,7 +604,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void)
|
||||
git_oid their_oids[1];
|
||||
git_merge_head *their_heads[1];
|
||||
git_merge_result *result;
|
||||
git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
|
||||
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
|
||||
|
||||
struct merge_index_entry merge_index_entries[] = {
|
||||
{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
|
||||
|
@ -398,8 +398,8 @@ void test_revert_workdir__rename_1_of_2(void)
|
||||
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 2, "file6.txt" },
|
||||
};
|
||||
|
||||
opts.merge_tree_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
|
||||
opts.merge_tree_opts.rename_threshold = 50;
|
||||
opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
|
||||
opts.merge_opts.rename_threshold = 50;
|
||||
|
||||
git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5");
|
||||
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
|
||||
@ -432,8 +432,8 @@ void test_revert_workdir__rename(void)
|
||||
{ "file4.txt", "file5.txt", "" },
|
||||
};
|
||||
|
||||
opts.merge_tree_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
|
||||
opts.merge_tree_opts.rename_threshold = 50;
|
||||
opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
|
||||
opts.merge_opts.rename_threshold = 50;
|
||||
|
||||
git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965");
|
||||
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
|
||||
|
@ -77,8 +77,8 @@ void test_structinit_structinit__compare(void)
|
||||
|
||||
/* merge_tree */
|
||||
CHECK_MACRO_FUNC_INIT_EQUAL( \
|
||||
git_merge_tree_opts, GIT_MERGE_TREE_OPTS_VERSION, \
|
||||
GIT_MERGE_TREE_OPTS_INIT, git_merge_tree_init_opts);
|
||||
git_merge_options, GIT_MERGE_OPTIONS_VERSION, \
|
||||
GIT_MERGE_OPTIONS_INIT, git_merge_init_options);
|
||||
|
||||
/* push */
|
||||
CHECK_MACRO_FUNC_INIT_EQUAL( \
|
||||
|
Loading…
Reference in New Issue
Block a user