diff --git a/diff-index.c b/diff-index.c
index 62b36cc8ee2bad8e4c37c4c7e2a99d6d4abc2f88..0054883a5e18aaacc682bb8369c6f0376cf75306 100644 (file)
--- a/diff-index.c
+++ b/diff-index.c
}
static int get_stat_data(struct cache_entry *ce,
- unsigned char **sha1p, unsigned int *modep)
+ unsigned char ** sha1p, unsigned int *modep)
{
unsigned char *sha1 = ce->sha1;
unsigned int mode = ce->ce_mode;
changed = ce_match_stat(ce, &st);
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))
+ mode = ce->ce_mode;
sha1 = no_sha1;
}
}
unsigned char *sha1;
unsigned int mode;
- /* New file in the index: it might actually be different in the working copy */
+ /* New file in the index: it might actually be different in
+ * the working copy.
+ */
if (get_stat_data(new, &sha1, &mode) < 0)
return;
int allow_options = 1;
int i;
+ git_config(git_diff_config);
diff_setup(&diff_options);
for (i = 1; i < argc; i++) {
const char *arg = argv[i];