merge-recursive: Mark some diff_filespec struct arguments const
[gitweb.git] / merge-recursive.c
index d6f238dab08a0bb56067d2eb409a9b46980eee04..8ad4c7ef3833eec106856a861c74018baa05d563 100644 (file)
@@ -459,9 +459,10 @@ static struct string_list *get_renames(struct merge_options *o,
        return renames;
 }
 
-static int update_stages_options(const char *path, struct diff_filespec *o,
-                        struct diff_filespec *a, struct diff_filespec *b,
-                        int clear, int options)
+static int update_stages_options(const char *path, const struct diff_filespec *o,
+                                const struct diff_filespec *a,
+                                const struct diff_filespec *b,
+                                int clear, int options)
 {
        if (clear)
                if (remove_file_from_cache(path))
@@ -710,9 +711,9 @@ struct merge_file_info {
 
 static int merge_3way(struct merge_options *o,
                      mmbuffer_t *result_buf,
-                     struct diff_filespec *one,
-                     struct diff_filespec *a,
-                     struct diff_filespec *b,
+                     const struct diff_filespec *one,
+                     const struct diff_filespec *a,
+                     const struct diff_filespec *b,
                      const char *branch1,
                      const char *branch2)
 {
@@ -770,9 +771,9 @@ static int merge_3way(struct merge_options *o,
 }
 
 static struct merge_file_info merge_file(struct merge_options *o,
-                                        struct diff_filespec *one,
-                                        struct diff_filespec *a,
-                                        struct diff_filespec *b,
+                                        const struct diff_filespec *one,
+                                        const struct diff_filespec *a,
+                                        const struct diff_filespec *b,
                                         const char *branch1,
                                         const char *branch2)
 {
@@ -1437,7 +1438,7 @@ static int process_df_entry(struct merge_options *o,
                handle_delete_modify(o, path, new_path,
                                     a_sha, a_mode, b_sha, b_mode);
        } else if (!o_sha && !!a_sha != !!b_sha) {
-               /* directory -> (directory, file) */
+               /* directory -> (directory, file) or <nothing> -> (directory, file) */
                const char *add_branch;
                const char *other_branch;
                unsigned mode;