| 790 | } |
| 791 | |
| 792 | void tweak_fsmonitor(struct index_state *istate) |
| 793 | { |
| 794 | unsigned int i; |
| 795 | int fsmonitor_enabled = (fsm_settings__get_mode(istate->repo) |
| 796 | > FSMONITOR_MODE_DISABLED); |
| 797 | |
| 798 | if (istate->fsmonitor_dirty) { |
| 799 | if (fsmonitor_enabled) { |
| 800 | /* Mark all entries valid */ |
| 801 | for (i = 0; i < istate->cache_nr; i++) { |
| 802 | if (S_ISGITLINK(istate->cache[i]->ce_mode)) |
| 803 | continue; |
| 804 | istate->cache[i]->ce_flags |= CE_FSMONITOR_VALID; |
| 805 | } |
| 806 | |
| 807 | /* Mark all previously saved entries as dirty */ |
| 808 | assert_index_minimum(istate, istate->fsmonitor_dirty->bit_size); |
| 809 | ewah_each_bit(istate->fsmonitor_dirty, fsmonitor_ewah_callback, istate); |
| 810 | |
| 811 | refresh_fsmonitor(istate); |
| 812 | } |
| 813 | |
| 814 | ewah_free(istate->fsmonitor_dirty); |
| 815 | istate->fsmonitor_dirty = NULL; |
| 816 | } |
| 817 | |
| 818 | if (fsmonitor_enabled) |
| 819 | add_fsmonitor(istate); |
| 820 | else |
| 821 | remove_fsmonitor(istate); |
| 822 | } |
no test coverage detected