git-merge: a bit more readable user guidance.
[git.git] / diff-index.c
index bbd873b..e376d65 100644 (file)
@@ -33,12 +33,10 @@ static int get_stat_data(struct cache_entry *ce,
                        }
                        return -1;
                }
-               changed = ce_match_stat(ce, &st);
+               changed = ce_match_stat(ce, &st, 0);
                if (changed) {
                        mode = create_ce_mode(st.st_mode);
-                       if (!trust_executable_bit &&
-                           S_ISREG(mode) && S_ISREG(ce->ce_mode) &&
-                           ((mode ^ ce->ce_mode) == 0111))
+                       if (!trust_executable_bit && S_ISREG(st.st_mode))
                                mode = ce->ce_mode;
                        sha1 = no_sha1;
                }
@@ -201,6 +199,14 @@ int main(int argc, const char **argv)
                        /* We accept the -r flag just to look like git-diff-tree */
                        continue;
                }
+               if (!strcmp(arg, "--cc"))
+                       /*
+                        * I _think_ "diff-index --cached HEAD" with an
+                        * unmerged index could show something else
+                        * later, but pretend --cc is the same as -p for
+                        * now.  "git diff" uses --cc by default.
+                        */
+                       argv[i] = arg = "-p";
                diff_opt_cnt = diff_opt_parse(&diff_options, argv + i,
                                              argc - i);
                if (diff_opt_cnt < 0)