commit 755ef0e
default
·
2023-12-08 07:34:51 +0000 UTC
parent c9b8f8c
Purge unused tags completely.
1 files changed,
+8,
-0
M
data.c
M
data.c
+8,
-0
1@@ -2537,6 +2537,14 @@ void purge_server(void)
2 tag_gc += index_gc(v2);
3 xs *bak = xs_fmt("%s.bak", v2);
4 unlink(bak);
5+
6+ if (index_len(v2) == 0) {
7+ /* there are no longer any entry with this tag;
8+ purge it completely */
9+ unlink(v2);
10+ xs *dottag = xs_replace(v2, ".idx", ".tag");
11+ unlink(dottag);
12+ }
13 }
14 }
15