Don't use -C in "git diff"
[gitweb.git] / apply.c
diff --git a/apply.c b/apply.c
index 01bcb947ed399a943b61336f9008d38d2cf514f5..c0cd1520db6ef1036678046fc5c8ada174155c49 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -989,7 +989,7 @@ static int check_patch(struct patch *patch)
                int changed;
 
                if (lstat(old_name, &st) < 0)
-                       return error("%s: %s\n", strerror(errno));
+                       return error("%s: %s", old_name, strerror(errno));
                if (check_index) {
                        int pos = cache_name_pos(old_name, strlen(old_name));
                        if (pos < 0)
@@ -1000,6 +1000,7 @@ static int check_patch(struct patch *patch)
                }
                if (patch->is_new < 0)
                        patch->is_new = 0;
+               st.st_mode = ntohl(create_ce_mode(st.st_mode));
                if (!patch->old_mode)
                        patch->old_mode = st.st_mode;
                if ((st.st_mode ^ patch->old_mode) & S_IFMT)