Merge branch 'dl/complete-cherry-pick-revert-skip'
[gitweb.git] / merge-recursive.h
index 248093e407c7744b1e3e9a5bd5780375a1c6c07f..c2b7bb65c62ff51af1b89087bbf6692060b5962e 100644 (file)
@@ -1,8 +1,12 @@
 #ifndef MERGE_RECURSIVE_H
 #define MERGE_RECURSIVE_H
 
-#include "unpack-trees.h"
 #include "string-list.h"
+#include "unpack-trees.h"
+
+struct commit;
+
+struct repository;
 
 struct merge_options {
        const char *ancestor;
@@ -18,7 +22,9 @@ struct merge_options {
        unsigned renormalize : 1;
        long xdl_opts;
        int verbosity;
-       int detect_rename;
+       int detect_directory_renames;
+       int diff_detect_rename;
+       int merge_detect_rename;
        int diff_rename_limit;
        int merge_rename_limit;
        int rename_score;
@@ -30,6 +36,7 @@ struct merge_options {
        struct string_list df_conflict_file_set;
        struct unpack_trees_options unpack_opts;
        struct index_state orig_index;
+       struct repository *repo;
 };
 
 /*
@@ -57,6 +64,12 @@ struct collision_entry {
        unsigned reported_already:1;
 };
 
+static inline int merge_detect_rename(struct merge_options *o)
+{
+       return o->merge_detect_rename >= 0 ? o->merge_detect_rename :
+               o->diff_detect_rename >= 0 ? o->diff_detect_rename : 1;
+}
+
 /* merge_trees() but with recursive ancestor consolidation */
 int merge_recursive(struct merge_options *o,
                    struct commit *h1,
@@ -82,7 +95,8 @@ int merge_recursive_generic(struct merge_options *o,
                            const struct object_id **ca,
                            struct commit **result);
 
-void init_merge_options(struct merge_options *o);
+void init_merge_options(struct merge_options *o,
+                       struct repository *repo);
 struct tree *write_tree_from_memory(struct merge_options *o);
 
 int parse_merge_opt(struct merge_options *out, const char *s);