Merge branch 'nd/no-more-check-racy'
[gitweb.git] / merge-recursive.c
index a596d95739a398af8940094989db62973e01a6ab..6c40c61c4728d9224006768599d7bf2ded744bb1 100644 (file)
@@ -475,7 +475,8 @@ static void get_files_dirs(struct merge_options *o, struct tree *tree)
 {
        struct pathspec match_all;
        memset(&match_all, 0, sizeof(match_all));
-       read_tree_recursive(tree, "", 0, 0, &match_all, save_files_dirs, o);
+       read_tree_recursive(the_repository, tree, "", 0, 0,
+                           &match_all, save_files_dirs, o);
 }
 
 static int get_tree_entry_if_blob(const struct object_id *tree,
@@ -1401,8 +1402,7 @@ static int merge_mode_and_contents(struct merge_options *o,
 
 static int handle_rename_via_dir(struct merge_options *o,
                                 struct diff_filepair *pair,
-                                const char *rename_branch,
-                                const char *other_branch)
+                                const char *rename_branch)
 {
        /*
         * Handle file adds that need to be renamed due to directory rename
@@ -2212,8 +2212,7 @@ static void handle_directory_level_conflicts(struct merge_options *o,
        remove_hashmap_entries(dir_re_merge, &remove_from_merge);
 }
 
-static struct hashmap *get_directory_renames(struct diff_queue_struct *pairs,
-                                            struct tree *tree)
+static struct hashmap *get_directory_renames(struct diff_queue_struct *pairs)
 {
        struct hashmap *dir_renames;
        struct hashmap_iter iter;
@@ -2459,8 +2458,7 @@ static void apply_directory_rename_modifications(struct merge_options *o,
                                                 struct tree *o_tree,
                                                 struct tree *a_tree,
                                                 struct tree *b_tree,
-                                                struct string_list *entries,
-                                                int *clean)
+                                                struct string_list *entries)
 {
        struct string_list_item *item;
        int stage = (tree == a_tree ? 2 : 3);
@@ -2631,8 +2629,7 @@ static struct string_list *get_renames(struct merge_options *o,
                        apply_directory_rename_modifications(o, pair, new_path,
                                                             re, tree, o_tree,
                                                             a_tree, b_tree,
-                                                            entries,
-                                                            clean_merge);
+                                                            entries);
        }
 
        hashmap_iter_init(&collisions, &iter);
@@ -2943,8 +2940,8 @@ static int detect_and_process_renames(struct merge_options *o,
        merge_pairs = get_diffpairs(o, common, merge);
 
        if (o->detect_directory_renames) {
-               dir_re_head = get_directory_renames(head_pairs, head);
-               dir_re_merge = get_directory_renames(merge_pairs, merge);
+               dir_re_head = get_directory_renames(head_pairs);
+               dir_re_merge = get_directory_renames(merge_pairs);
 
                handle_directory_level_conflicts(o,
                                                 dir_re_head, head,
@@ -3267,8 +3264,7 @@ static int process_entry(struct merge_options *o,
                        clean_merge = 1;
                        if (handle_rename_via_dir(o,
                                                  conflict_info->pair1,
-                                                 conflict_info->branch1,
-                                                 conflict_info->branch2))
+                                                 conflict_info->branch1))
                                clean_merge = -1;
                        break;
                case RENAME_ADD:
@@ -3412,7 +3408,7 @@ int merge_trees(struct merge_options *o,
        int code, clean;
        struct strbuf sb = STRBUF_INIT;
 
-       if (!o->call_depth && index_has_changes(istate, head, &sb)) {
+       if (!o->call_depth && repo_index_has_changes(o->repo, head, &sb)) {
                err(o, _("Your local changes to the following files would be overwritten by merge:\n  %s"),
                    sb.buf);
                return -1;
@@ -3763,6 +3759,10 @@ int parse_merge_opt(struct merge_options *o, const char *s)
                        return -1;
                o->merge_detect_rename = 1;
        }
+       /*
+        * Please update $__git_merge_strategy_options in
+        * git-completion.bash when you add new options
+        */
        else
                return -1;
        return 0;