]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/checkout.c
Merge branch 'rs/preserve-merges-unused-code-removal'
[thirdparty/git.git] / builtin / checkout.c
index af849c644fec1852845b1dfdb6ce8daa903e0fb5..283719549120f23fff4441d450da604598c320c0 100644 (file)
@@ -239,6 +239,8 @@ static int checkout_merged(int pos, const struct checkout *state, int *nr_checko
        mmbuffer_t result_buf;
        struct object_id threeway[3];
        unsigned mode = 0;
+       struct ll_merge_options ll_opts;
+       int renormalize = 0;
 
        memset(threeway, 0, sizeof(threeway));
        while (pos < active_nr) {
@@ -259,13 +261,12 @@ static int checkout_merged(int pos, const struct checkout *state, int *nr_checko
        read_mmblob(&ours, &threeway[1]);
        read_mmblob(&theirs, &threeway[2]);
 
-       /*
-        * NEEDSWORK: re-create conflicts from merges with
-        * merge.renormalize set, too
-        */
+       memset(&ll_opts, 0, sizeof(ll_opts));
+       git_config_get_bool("merge.renormalize", &renormalize);
+       ll_opts.renormalize = renormalize;
        status = ll_merge(&result_buf, path, &ancestor, "base",
                          &ours, "ours", &theirs, "theirs",
-                         state->istate, NULL);
+                         state->istate, &ll_opts);
        free(ancestor.ptr);
        free(ours.ptr);
        free(theirs.ptr);
@@ -771,13 +772,6 @@ static int merge_working_tree(const struct checkout_opts *opts,
                         */
 
                        add_files_to_cache(NULL, NULL, 0);
-                       /*
-                        * NEEDSWORK: carrying over local changes
-                        * when branches have different end-of-line
-                        * normalization (or clean+smudge rules) is
-                        * a pain; plumb in an option to set
-                        * o.renormalize?
-                        */
                        init_merge_options(&o, the_repository);
                        o.verbosity = 0;
                        work = write_in_core_index_as_tree(the_repository);