Be much more liberal about the file mode bits.
[gitweb.git] / update-cache.c
index 134ba7439891d698c4b82223a9e872d3a77e5edb..7d1d8e512617dc4a3b77a922f2765e79201895ab 100644 (file)
@@ -106,7 +106,7 @@ static int add_file_to_cache(char *path)
        memset(ce, 0, size);
        memcpy(ce->name, path, namelen);
        fill_stat_cache_info(ce, &st);
-       ce->ce_mode = htonl(st.st_mode);
+       ce->ce_mode = create_ce_mode(st.st_mode);
        ce->ce_flags = htons(namelen);
 
        if (index_fd(path, namelen, ce, fd, &st) < 0)
@@ -260,7 +260,7 @@ static int add_cacheinfo(char *arg1, char *arg2, char *arg3)
        memcpy(ce->sha1, sha1, 20);
        memcpy(ce->name, arg3, len);
        ce->ce_flags = htons(len);
-       ce->ce_mode = htonl(mode);
+       ce->ce_mode = create_ce_mode(mode);
        return add_cache_entry(ce, allow_add);
 }