Skip to content

Commit

Permalink
Filter symlink and block file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Nov 16, 2023
1 parent b975825 commit 495be70
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions autogit/include/watchman/linux/linux_watchman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,15 @@ namespace watchman {
for (fs::directory_iterator it(dir); it != end; ++it)
{
boost::system::error_code ignore_ec;
if (fs::is_directory(*it, ignore_ec))
const auto& item = *it;

auto status = fs::status(item);

if (fs::is_directory(item, ignore_ec) &&
!(fs::is_symlink(status) || fs::is_block_file(status)))
{
add_directory(*it);
add_sub_directory(*it);
add_directory(item);
add_sub_directory(item);
}
}
}
Expand Down

0 comments on commit 495be70

Please sign in to comment.