rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = update_callback;
rev.diffopt.format_callback_data = &verbose;
- run_diff_files(&rev, 0);
- if (read_cache() < 0)
- die("index file corrupt");
+ run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
}
static void refresh(int verbose, const char **pathspec)
extern int add_file_to_index(struct index_state *, const char *path, int verbose);
extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh);
extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);
- extern int ie_match_stat(struct index_state *, struct cache_entry *, struct stat *, int);
- extern int ie_modified(struct index_state *, struct cache_entry *, struct stat *, int);
+
+ /* do stat comparison even if CE_VALID is true */
+ #define CE_MATCH_IGNORE_VALID 01
+ /* do not check the contents but report dirty on racily-clean entries */
+ #define CE_MATCH_RACY_IS_DIRTY 02
+ extern int ie_match_stat(struct index_state *, struct cache_entry *, struct stat *, unsigned int);
+ extern int ie_modified(struct index_state *, struct cache_entry *, struct stat *, unsigned int);
+
extern int ce_path_match(const struct cache_entry *ce, const char **pathspec);
extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path);
-extern int read_fd(int fd, char **return_buf, unsigned long *return_size);
extern int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object);
extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object);
extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);