From: Junio C Hamano Date: Wed, 25 Apr 2018 04:29:04 +0000 (+0900) Subject: Merge branch 'bp/fsmonitor-prime-index' X-Git-Tag: v2.18.0-rc0~111 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7a79d7e9fb187f17515053f616d3eca13c9c1585?ds=inline;hp=-c Merge branch 'bp/fsmonitor-prime-index' The index file is updated to record the fsmonitor section after a full scan was made, to avoid wasting the effort that has already spent. * bp/fsmonitor-prime-index: fsmonitor: force index write after full scan --- 7a79d7e9fb187f17515053f616d3eca13c9c1585 diff --combined fsmonitor.c index eb4e642256,2b4d3bb0a2..ed3d1a074d --- a/fsmonitor.c +++ b/fsmonitor.c @@@ -104,7 -104,7 +104,7 @@@ static int query_fsmonitor(int version if (!(argv[0] = core_fsmonitor)) return -1; - snprintf(ver, sizeof(version), "%d", version); + snprintf(ver, sizeof(ver), "%d", version); snprintf(date, sizeof(date), "%" PRIuMAX, (uintmax_t)last_update); argv[1] = ver; argv[2] = date; @@@ -185,6 -185,9 +185,9 @@@ void refresh_fsmonitor(struct index_sta for (i = 0; i < istate->cache_nr; i++) istate->cache[i]->ce_flags &= ~CE_FSMONITOR_VALID; + /* If we're going to check every file, ensure we save the results */ + istate->cache_changed |= FSMONITOR_CHANGED; + if (istate->untracked) istate->untracked->use_fsmonitor = 0; }