author | Junio C Hamano <gitster@pobox.com> | |
Wed, 14 Nov 2007 22:15:40 +0000 (14:15 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 14 Nov 2007 22:15:40 +0000 (14:15 -0800) |
* jc/maint-add-sync-stat:
t2200: test more cases of "add -u"
git-add: make the entry stat-clean after re-adding the same contents
ce_match_stat, run_diff_files: use symbolic constants for readability
Conflicts:
builtin-add.c
t2200: test more cases of "add -u"
git-add: make the entry stat-clean after re-adding the same contents
ce_match_stat, run_diff_files: use symbolic constants for readability
Conflicts:
builtin-add.c
1 | 2 | |||
---|---|---|---|---|
builtin-add.c | patch | | diff1 | | diff2 | | blob | history |
builtin-apply.c | patch | | diff1 | | diff2 | | blob | history |
cache.h | patch | | diff1 | | diff2 | | blob | history |
entry.c | patch | | diff1 | | diff2 | | blob | history |
read-cache.c | patch | | diff1 | | diff2 | | blob | history |
unpack-trees.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin-add.c
index 45b14e8a61764e18d8b89ebfef550a820ffbf831,e072320d20df64e2db062009c60cb488235076a4..77dcde6936155953b5a7321dcbf7430cb5aa73a3
--- 1/builtin-add.c
--- 2/builtin-add.c
+++ b/builtin-add.c
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)
diff --cc builtin-apply.c
Simple merge
diff --cc cache.h
index f0a25c7ffcd47d663f2d41cd29dbabc57c2cab93,31af16a7eee5e151dbcff320dca094b9c9ff17b8..f4f27cd70d6077e69e38184f7aad27204131fefb
+++ b/cache.h
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);
diff --cc entry.c
Simple merge
diff --cc read-cache.c
Simple merge
diff --cc unpack-trees.c
Simple merge