summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-03-08 17:12:39 +0700
committerJunio C Hamano <gitster@pobox.com>2015-03-12 13:45:17 -0700
commit1bbb3dba3fbf733db45f073ddafe89f5972c516a (patch)
treef93065c23557934c21e4c7cf2581530a963769ee /dir.c
parentc9ccb5d327bd9259ca6cceb9d87df9eb2cba2e9d (diff)
downloadgit-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>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 1cf1e3002e..592b5fa795 100644
--- a/dir.c
+++ b/dir.c
@@ -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;
}