]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff-lib.c
remote-mediawiki tests: use a more idiomatic dispatch table
[thirdparty/git.git] / diff-lib.c
index 25fd2dee19c4a8f6408d768d44d8dc92aeaf0ed3..5d5d3dafab3386920d2c0883d33d06f860f6d11b 100644 (file)
@@ -219,7 +219,8 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
                                continue;
                        } else if (revs->diffopt.ita_invisible_in_index &&
                                   ce_intent_to_add(ce)) {
-                               diff_addremove(&revs->diffopt, '+', ce->ce_mode,
+                               newmode = ce_mode_from_stat(ce, st.st_mode);
+                               diff_addremove(&revs->diffopt, '+', newmode,
                                               &null_oid, 0, ce->name, 0);
                                continue;
                        }
@@ -404,14 +405,8 @@ static void do_oneway_diff(struct unpack_trees_options *o,
        /* if the entry is not checked out, don't examine work tree */
        cached = o->index_only ||
                (idx && ((idx->ce_flags & CE_VALID) || ce_skip_worktree(idx)));
-       /*
-        * Backward compatibility wart - "diff-index -m" does
-        * not mean "do not ignore merges", but "match_missing".
-        *
-        * But with the revision flag parsing, that's found in
-        * "!revs->ignore_merges".
-        */
-       match_missing = !revs->ignore_merges;
+
+       match_missing = revs->match_missing;
 
        if (cached && idx && ce_stage(idx)) {
                struct diff_filepair *pair;