Merge branch 'bp/fsmonitor-prime-index'
authorJunio C Hamano <gitster@pobox.com>
Wed, 25 Apr 2018 04:29:04 +0000 (13:29 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Apr 2018 04:29:04 +0000 (13:29 +0900)
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

1  2 
fsmonitor.c
diff --combined fsmonitor.c
index eb4e6422562c89686f1bc9666b031a7ce7083a6e,2b4d3bb0a250642e5ea3479fad217683bd7b0b0f..ed3d1a074d60309063d16044bfd83beb78ef0e9d
@@@ -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;
        }