From c9ac60a2fc0e33c7d6d86d0ac02d4efabbf6049a Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 18 Dec 2024 09:12:15 -0600 Subject: [PATCH] file db unit tests and fixes --- .../src/providers/encrypt/encrypt_provider.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp b/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp index 8a562855..005f721d 100644 --- a/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp +++ b/repertory/librepertory/src/providers/encrypt/encrypt_provider.cpp @@ -533,8 +533,14 @@ auto encrypt_provider::is_directory(const std::string &api_path, try { std::string source_path; auto result = db_->get_directory_source_path(api_path, source_path); + if (result != api_error::success) { - return result; + if (result != api_error::directory_not_found) { + return result; + } + + exists = false; + return api_error::success; } exists = utils::file::directory{source_path}.exists(); @@ -555,7 +561,12 @@ auto encrypt_provider::is_file(const std::string &api_path, bool &exists) const std::string source_path; auto result = db_->get_file_source_path(api_path, source_path); if (result != api_error::success) { - return result; + if (result != api_error::item_not_found) { + return result; + } + + exists = false; + return api_error::success; } exists = utils::file::file{source_path}.exists();