diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-05-19 16:45:33 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-19 16:45:33 +0900 |
commit | cfd635c7428dfca5b45d8d45fdc1311e751d4fe2 (patch) | |
tree | 3bd1754e72887659e52ee03342a4a9098fe9c247 /fsmonitor.c | |
parent | 521d3ef38a17917ad10e71a398e82a13fa1178b5 (diff) | |
parent | 398a3b0899dd8a440d4adbcbda38362e3f8359b1 (diff) |
Merge branch 'js/fsmonitor-refresh-after-discarding-index'
The fsmonitor interface got out of sync after the in-core index
file gets discarded, which has been corrected.
* js/fsmonitor-refresh-after-discarding-index:
fsmonitor: force a refresh after the index was discarded
fsmonitor: demonstrate that it is not refreshed after discard_index()
Diffstat (limited to 'fsmonitor.c')
-rw-r--r-- | fsmonitor.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fsmonitor.c b/fsmonitor.c index 665bd2d425..1dee0aded1 100644 --- a/fsmonitor.c +++ b/fsmonitor.c @@ -129,7 +129,6 @@ static void fsmonitor_refresh_callback(struct index_state *istate, const char *n void refresh_fsmonitor(struct index_state *istate) { - static int has_run_once = 0; struct strbuf query_result = STRBUF_INIT; int query_success = 0; size_t bol; /* beginning of line */ @@ -137,9 +136,9 @@ void refresh_fsmonitor(struct index_state *istate) char *buf; int i; - if (!core_fsmonitor || has_run_once) + if (!core_fsmonitor || istate->fsmonitor_has_run_once) return; - has_run_once = 1; + istate->fsmonitor_has_run_once = 1; trace_printf_key(&trace_fsmonitor, "refresh fsmonitor"); /* |