status: be prepared for not-yet-started interactive rebase
[gitweb.git] / read-cache.c
index d11a43beb60a7c014e4595b7e7ac75d7fdf67385..248432af430d7e5b147898b2ac61f2ebbb468070 100644 (file)
@@ -19,9 +19,6 @@
 #include "split-index.h"
 #include "utf8.h"
 
-static struct cache_entry *refresh_cache_entry(struct cache_entry *ce,
-                                              unsigned int options);
-
 /* Mask for the name length in ce_flags in the on-disk index */
 
 #define CE_NAMEMASK  (0x0fff)
@@ -630,7 +627,7 @@ void set_object_name_for_intent_to_add_entry(struct cache_entry *ce)
        hashcpy(ce->sha1, sha1);
 }
 
-int add_to_index(struct index_state *istate, const char *path, struct stat *st, int flags, int force_mode)
+int add_to_index(struct index_state *istate, const char *path, struct stat *st, int flags)
 {
        int size, namelen, was_same;
        mode_t st_mode = st->st_mode;
@@ -659,11 +656,10 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
        else
                ce->ce_flags |= CE_INTENT_TO_ADD;
 
-       if (S_ISREG(st_mode) && force_mode)
-               ce->ce_mode = create_ce_mode(force_mode);
-       else if (trust_executable_bit && has_symlinks)
+
+       if (trust_executable_bit && has_symlinks) {
                ce->ce_mode = create_ce_mode(st_mode);
-       else {
+       else {
                /* If there is an existing entry, pick the mode bits and type
                 * from it, otherwise assume unexecutable regular file.
                 */
@@ -722,13 +718,12 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
        return 0;
 }
 
-int add_file_to_index(struct index_state *istate, const char *path,
-       int flags, int force_mode)
+int add_file_to_index(struct index_state *istate, const char *path, int flags)
 {
        struct stat st;
        if (lstat(path, &st))
                die_errno("unable to stat '%s'", path);
-       return add_to_index(istate, path, &st, flags, force_mode);
+       return add_to_index(istate, path, &st, flags);
 }
 
 struct cache_entry *make_cache_entry(unsigned int mode,
@@ -1286,7 +1281,7 @@ int refresh_index(struct index_state *istate, unsigned int flags,
        return has_errors;
 }
 
-static struct cache_entry *refresh_cache_entry(struct cache_entry *ce,
+struct cache_entry *refresh_cache_entry(struct cache_entry *ce,
                                               unsigned int options)
 {
        return refresh_cache_ent(&the_index, ce, options, NULL, NULL);