summaryrefslogtreecommitdiff
path: root/update-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 05:26:31 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 05:26:31 (GMT)
commite44794706eeb57f2ee38ed1604821aa38b8ad9d2 (patch)
treec49cd3e4f1dfe4ccbf2b8d00188beaa251fee028 /update-cache.c
parent9fec8b26eff58e1f595e8619abf1e42c07645ff8 (diff)
downloadgit-e44794706eeb57f2ee38ed1604821aa38b8ad9d2.zip
git-e44794706eeb57f2ee38ed1604821aa38b8ad9d2.tar.gz
git-e44794706eeb57f2ee38ed1604821aa38b8ad9d2.tar.bz2
Be much more liberal about the file mode bits.
We only really care about the difference between a file being executable or not (by its owner). Everything else we leave for the user umask to decide.
Diffstat (limited to 'update-cache.c')
-rw-r--r--update-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/update-cache.c b/update-cache.c
index 134ba74..7d1d8e5 100644
--- a/update-cache.c
+++ b/update-cache.c
@@ -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);
}