Commit f29dde682866c293292ce405fcfef1511ced3f55

Jacques Germishuys 2015-03-12T12:29:47

Renamed git_merge_options 'flags' to 'tree_flags'

diff --git a/include/git2/merge.h b/include/git2/merge.h
index 73375b3..387197a 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -63,7 +63,7 @@ GIT_EXTERN(int) git_merge_file_init_input(
 
 /**
  * Flags for `git_merge_tree` options.  A combination of these flags can be
- * passed in via the `flags` value in the `git_merge_options`.
+ * passed in via the `tree_flags` value in the `git_merge_options`.
  */
 typedef enum {
 	/**
@@ -225,7 +225,7 @@ typedef struct {
  */
 typedef struct {
 	unsigned int version;
-	git_merge_tree_flag_t flags;
+	git_merge_tree_flag_t tree_flags;
 
 	/**
 	 * Similarity to consider a file renamed (default 50).  If
diff --git a/src/merge.c b/src/merge.c
index 2972d9f..12e85ff 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -1154,7 +1154,7 @@ int git_merge_diff_list__find_renames(
 
 	assert(diff_list && opts);
 
-	if ((opts->flags & GIT_MERGE_TREE_FIND_RENAMES) == 0)
+	if ((opts->tree_flags & GIT_MERGE_TREE_FIND_RENAMES) == 0)
 		return 0;
 
 	similarity_ours = git__calloc(diff_list->conflicts.length,
@@ -1593,7 +1593,7 @@ static int merge_normalize_opts(
 		git_merge_options init = GIT_MERGE_OPTIONS_INIT;
 		memcpy(opts, &init, sizeof(init));
 
-		opts->flags = GIT_MERGE_TREE_FIND_RENAMES;
+		opts->tree_flags = GIT_MERGE_TREE_FIND_RENAMES;
 		opts->rename_threshold = GIT_MERGE_TREE_RENAME_THRESHOLD;
 	}
 
diff --git a/tests/cherrypick/workdir.c b/tests/cherrypick/workdir.c
index f8b4ca2..787f1f4 100644
--- a/tests/cherrypick/workdir.c
+++ b/tests/cherrypick/workdir.c
@@ -300,7 +300,7 @@ void test_cherrypick_workdir__rename(void)
 		{ 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 0, "file3.txt.renamed" },
 	};
 
-	opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
@@ -335,7 +335,7 @@ void test_cherrypick_workdir__both_renamed(void)
 		{ 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 2, "file3.txt.renamed_on_branch" },
 	};
 
-	opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70");
diff --git a/tests/merge/trees/treediff.c b/tests/merge/trees/treediff.c
index 8b47f7d..eea651d 100644
--- a/tests/merge/trees/treediff.c
+++ b/tests/merge/trees/treediff.c
@@ -45,7 +45,7 @@ static void test_find_differences(
     git_tree *ancestor_tree, *ours_tree, *theirs_tree;
 
 	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
-	opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	opts.target_limit = 1000;
 	opts.rename_threshold = 50;
 
diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c
index 807a88f..83006a7 100644
--- a/tests/merge/workdir/renames.c
+++ b/tests/merge/workdir/renames.c
@@ -63,7 +63,7 @@ void test_merge_workdir_renames__renames(void)
 		{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" },
 	};
 
-	merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	merge_opts.rename_threshold = 50;
 
 	cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL));
@@ -99,7 +99,7 @@ void test_merge_workdir_renames__ours(void)
 		{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 0, "7-both-renamed.txt" },
 	};
 
-	merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	merge_opts.rename_threshold = 50;
 	checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
 
@@ -147,7 +147,7 @@ void test_merge_workdir_renames__similar(void)
 		{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" },
 	};
 
-	merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	merge_opts.rename_threshold = 50;
 
 	cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL));
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index 171cacb..7ccf0f9 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -408,7 +408,7 @@ void test_revert_workdir__rename_1_of_2(void)
 		{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 2, "file6.txt" },
 	};
 
-	opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5");
@@ -442,7 +442,7 @@ void test_revert_workdir__rename(void)
 		{ "file4.txt", "file5.txt", "" },
 	};
 
-	opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965");