assume unchanged git: diff-index fix.
authorJunio C Hamano <junkio@cox.net>
Thu, 30 Mar 2006 07:00:42 +0000 (23:00 -0800)
committerJunio C Hamano <junkio@cox.net>
Thu, 30 Mar 2006 07:53:05 +0000 (23:53 -0800)
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>
diff-index.c

index 12a9418d6bbec35d2e5bc0010aff4366e63d7440..e376d65f800c2b554308b60925eb0042d8f21cec 100644 (file)
@@ -36,9 +36,7 @@ static int get_stat_data(struct cache_entry *ce,
                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;
                }