From b263a6aabf73eb27a56d35db69892de400635f2f Mon Sep 17 00:00:00 2001 From: Michal Sieron Date: Sun, 31 Aug 2025 17:57:44 +0200 Subject: [PATCH] db: Support cachedir paths containing dots Current implementation counts dots in the entire path, which disallows having cachedir under a path containig any dots. To fix this we can call FilenameHasRepoSuffix with only the filename part of the path. --- src/db.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.cc b/src/db.cc index a51381b..2287db5 100644 --- a/src/db.cc +++ b/src/db.cc @@ -80,7 +80,7 @@ std::unique_ptr Database::Open(std::string_view dbpath, Repos repos; for (const auto& entry : fs::directory_iterator(dbpath, ec)) { const fs::path& pathname = entry.path(); - if (!entry.is_regular_file() || !FilenameHasRepoSuffix(pathname.native())) { + if (!entry.is_regular_file() || !FilenameHasRepoSuffix(pathname.filename().native())) { continue; }