path: root/builtin-update-index.c
diff options
authorJunio C Hamano <>2006-09-28 05:23:12 (GMT)
committerJunio C Hamano <>2006-09-28 05:23:12 (GMT)
commit2958d9b5dbebeb82e7230bbfd3f421781d90f3f7 (patch)
tree881c16a7442a1829d8959aee272f50065c53b582 /builtin-update-index.c
parent194db7e3bbab9669c511133549e6ae74481c9a4f (diff)
parent51b2dd4e3f730f6be6c19faf3b4a04caea9e0420 (diff)
Merge branch 'master' into lj/refs
* master: (72 commits) runstatus: do not recurse into subdirectories if not needed grep: fix --fixed-strings combined with expression. grep: free expressions and patterns when done. Corrected copy-and-paste thinko in ignore executable bit test case. An illustration of rev-list --parents --pretty=raw Allow git-checkout when on a non-existant branch. gitweb: Decode long title for link tooltips git-svn: Fix fetch --no-ignore-externals with GIT_SVN_NO_LIB=1 Ignore executable bit when adding files if filemode=0. Remove empty ref directories that prevent creating a ref. Use const for interpolate arguments git-archive: update documentation Deprecate gitweb: fix over-eager application of esc_html(). Allow '(no author)' in git-svn's authors file. Allow 'svn fetch' on '(no date)' revisions in Subversion. git-repack: allow git-repack to run in subdirectory Remove upload-tar and make git-tar-tree a thin wrapper to git-archive git-tar-tree: Move code for git-archive --format=tar to archive-tar.c git-tar-tree: Remove duplicate git_config() call ...
Diffstat (limited to 'builtin-update-index.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 09214c8..7f9c638 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -112,11 +112,13 @@ static int add_file_to_cache(const char *path)
ce->ce_mode = create_ce_mode(st.st_mode);
if (!trust_executable_bit) {
/* If there is an existing entry, pick the mode bits
- * from it.
+ * from it, otherwise force to 644.
int pos = cache_name_pos(path, namelen);
if (0 <= pos)
ce->ce_mode = active_cache[pos]->ce_mode;
+ else
+ ce->ce_mode = create_ce_mode(S_IFREG | 0644);
if (index_path(ce->sha1, path, &st, !info_only))