diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2015-03-08 17:12:39 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-12 13:45:17 -0700 |
commit | 1bbb3dba3fbf733db45f073ddafe89f5972c516a (patch) | |
tree | f93065c23557934c21e4c7cf2581530a963769ee | |
parent | c9ccb5d327bd9259ca6cceb9d87df9eb2cba2e9d (diff) | |
download | git-1bbb3dba3fbf733db45f073ddafe89f5972c516a.tar.gz |
untracked cache: mark index dirty if untracked cache is updated
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | cache.h | 1 | ||||
-rw-r--r-- | dir.c | 9 | ||||
-rw-r--r-- | read-cache.c | 2 |
3 files changed, 11 insertions, 1 deletions
@@ -289,6 +289,7 @@ static inline unsigned int canon_mode(unsigned int mode) #define RESOLVE_UNDO_CHANGED (1 << 4) #define CACHE_TREE_CHANGED (1 << 5) #define SPLIT_INDEX_ORDERED (1 << 6) +#define UNTRACKED_CHANGED (1 << 7) struct split_index; struct untracked_cache; @@ -1934,6 +1934,15 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const stru dir->untracked->gitignore_invalidated, dir->untracked->dir_invalidated, dir->untracked->dir_opened); + if (dir->untracked == the_index.untracked && + (dir->untracked->dir_opened || + dir->untracked->gitignore_invalidated || + dir->untracked->dir_invalidated)) + the_index.cache_changed |= UNTRACKED_CHANGED; + if (dir->untracked != the_index.untracked) { + free(dir->untracked); + dir->untracked = NULL; + } } return dir->nr; } diff --git a/read-cache.c b/read-cache.c index 57828bb3f3..705469eb7a 100644 --- a/read-cache.c +++ b/read-cache.c @@ -44,7 +44,7 @@ static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, /* changes that can be kept in $GIT_DIR/index (basically all extensions) */ #define EXTMASK (RESOLVE_UNDO_CHANGED | CACHE_TREE_CHANGED | \ CE_ENTRY_ADDED | CE_ENTRY_REMOVED | CE_ENTRY_CHANGED | \ - SPLIT_INDEX_ORDERED) + SPLIT_INDEX_ORDERED | UNTRACKED_CHANGED) struct index_state the_index; static const char *alternate_index_output; |