summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/file_system/file_system_manager.hpp11
-rw-r--r--src/other_tools/root_maps/fpath_git_map.cpp4
2 files changed, 7 insertions, 8 deletions
diff --git a/src/buildtool/file_system/file_system_manager.hpp b/src/buildtool/file_system/file_system_manager.hpp
index a6d15c84..528d50ca 100644
--- a/src/buildtool/file_system/file_system_manager.hpp
+++ b/src/buildtool/file_system/file_system_manager.hpp
@@ -408,10 +408,10 @@ class FileSystemManager {
return false;
}
+ /// \brief Copy directory recursively
[[nodiscard]] static auto CopyDirectoryImpl(
std::filesystem::path const& src,
- std::filesystem::path const& dst,
- bool recursively = false) noexcept -> bool {
+ std::filesystem::path const& dst) noexcept -> bool {
try {
// also checks existence
if (not IsDirectory(src)) {
@@ -428,11 +428,10 @@ class FileSystemManager {
dst.string());
return false;
}
- auto const opts =
+ static constexpr auto kOptions =
std::filesystem::copy_options::copy_symlinks |
- (recursively ? std::filesystem::copy_options::recursive
- : std::filesystem::copy_options::none);
- std::filesystem::copy(src, dst, opts);
+ std::filesystem::copy_options::recursive;
+ std::filesystem::copy(src, dst, kOptions);
return true;
} catch (std::exception const& e) {
Logger::Log(LogLevel::Error,
diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp
index 4f9e3685..38a63bf9 100644
--- a/src/other_tools/root_maps/fpath_git_map.cpp
+++ b/src/other_tools/root_maps/fpath_git_map.cpp
@@ -412,8 +412,8 @@ auto CreateFilePathGitMap(
return;
}
// copy folder content to tmp dir
- if (not FileSystemManager::CopyDirectoryImpl(
- key.fpath, tmp_dir->GetPath(), /*recursively=*/true)) {
+ if (not FileSystemManager::CopyDirectoryImpl(key.fpath,
+ tmp_dir->GetPath())) {
(*logger)(
fmt::format("Failed to copy content from directory {}",
key.fpath.string()),