Windows: start_command: Support non-NULL dir in struct child_process
[gitweb.git] / diff-lib.c
index ea9cf561cd66564602ab3a66c29a15dc85ae19b0..c50f7e39847a5363c8d8859e381259ffd6e57f0b 100644 (file)
@@ -71,9 +71,7 @@ static int match_stat_with_submodule(struct diff_options *diffopt,
        if (S_ISGITLINK(ce->ce_mode)
            && !DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)
            && (!changed || DIFF_OPT_TST(diffopt, DIRTY_SUBMODULES))) {
-               *dirty_submodule = is_submodule_modified(ce->name);
-               if (*dirty_submodule)
-                       changed = 1;
+               *dirty_submodule = is_submodule_modified(ce->name, DIFF_OPT_TST(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES));
        }
        return changed;
 }
@@ -202,7 +200,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
                }
                changed = match_stat_with_submodule(&revs->diffopt, ce, &st,
                                                    ce_option, &dirty_submodule);
-               if (!changed) {
+               if (!changed && !dirty_submodule) {
                        ce_mark_uptodate(ce);
                        if (!DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER))
                                continue;
@@ -333,7 +331,7 @@ static int show_modified(struct rev_info *revs,
        }
 
        oldmode = old->ce_mode;
-       if (mode == oldmode && !hashcmp(sha1, old->sha1) &&
+       if (mode == oldmode && !hashcmp(sha1, old->sha1) && !dirty_submodule &&
            !DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER))
                return 0;