]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsmonitor: do not forget to release the token in `discard_index()`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 17 Mar 2021 15:30:49 +0000 (15:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Mar 2021 19:19:28 +0000 (12:19 -0700)
In 56c6910028a (fsmonitor: change last update timestamp on the
index_state to opaque token, 2020-01-07), we forgot to adjust
`discard_index()` to release the "last-update" token: it is no longer a
64-bit number, but a free-form string that has been allocated.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c

index 29144cf879e795c3f5415cd5dd50f53a5dfb0cac..d19f506cd495b784bf541f5489c180476a02da0f 100644 (file)
@@ -2355,6 +2355,7 @@ int discard_index(struct index_state *istate)
        cache_tree_free(&(istate->cache_tree));
        istate->initialized = 0;
        istate->fsmonitor_has_run_once = 0;
+       FREE_AND_NULL(istate->fsmonitor_last_update);
        FREE_AND_NULL(istate->cache);
        istate->cache_alloc = 0;
        discard_split_index(istate);