@matheusbsbs / matheus-bagliano / commits / e464f4c311
Fork 0

assume unchanged git: diff-index fix.

When the executable bit is untrustworthy and when we are comparing the tree with the working tree, we tried to reuse the mode bits recorded in the index incorrectly (the computation was bogus on little endian architectures). Just use mode from index when it is a regular file. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Mar 29, 2006 at 23:00 UTC e464f4c3119b04712ab87329f3dd4d4f21b0a8a7
1 file changed +1 -3
diff-index.c
+1 -3
@@ -36,9 +36,7 @@ static int get_stat_data(struct cache_entry *ce,
36 changed = ce_match_stat(ce, &st, 0);
37 if (changed) {
38 mode = create_ce_mode(st.st_mode);
39 - if (!trust_executable_bit &&
40 - S_ISREG(mode) && S_ISREG(ce->ce_mode) &&
41 - ((mode ^ ce->ce_mode) == 0111))
39 + if (!trust_executable_bit && S_ISREG(st.st_mode))
40 mode = ce->ce_mode;
41 sha1 = no_sha1;
42 }