{"thread":{"id":"5197","subject":"[PATCH] discard_cache(): discard index, even if no file was mmap()ed","startedAt":"2006-08-10T14:47:21Z","lastAt":"2006-08-10T14:47:21Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25092","messageId":"Pine.LNX.4.63.0608101645590.10541@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5197","inReplyTo":null,"subject":"[PATCH] discard_cache(): discard index, even if no file was mmap()ed","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-10T14:47:21Z","receivedAt":"2006-08-10T14:47:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSince add_cacheinfo() can be called without a mapped index file,\ndiscard_cache() _has_ to discard the entries, even when\ncache_mmap == NULL.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\n---\n\n\tThis fixes 41094b8e, the only showstopper I wrote\n\tabout in my last -recur status report. The index file is\n\tnow the same for -recur and -recursive when trying to recreate \n\t41094b8e.\n\n\tHappy.\n\n read-cache.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/read-cache.c b/read-cache.c\nindex de8f690..3559bdc 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -841,14 +841,14 @@ int discard_cache()\n {\n \tint ret;\n \n+\tactive_nr = active_cache_changed = 0;\n+\tindex_file_timestamp = 0;\n+\tcache_tree_free(&active_cache_tree);\n \tif (cache_mmap == NULL)\n \t\treturn 0;\n \tret = munmap(cache_mmap, cache_mmap_size);\n \tcache_mmap = NULL;\n \tcache_mmap_size = 0;\n-\tactive_nr = active_cache_changed = 0;\n-\tindex_file_timestamp = 0;\n-\tcache_tree_free(&active_cache_tree);\n \n \t/* no need to throw away allocated active_cache */\n \treturn ret;\n-- \n1.4.2.rc4.g0d295-dirty\n"}]}