Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip .git dirs & .mohidden files #60

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/usvfs_dll/usvfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,9 @@ BOOL WINAPI VirtualLinkDirectoryStatic(LPCWSTR source, LPCWSTR destination, unsi
for (winapi::ex::wide::FileResult file :
winapi::ex::wide::quickFindFiles(sourceP.c_str(), L"*")) {
if (file.attributes & FILE_ATTRIBUTE_DIRECTORY) {
if (file.fileName == L".git") {
continue;
}
if ((file.fileName != L".") && (file.fileName != L"..")) {
VirtualLinkDirectoryStatic((sourceW + file.fileName).c_str(),
(destinationW + file.fileName).c_str(),
Expand All @@ -771,6 +774,10 @@ BOOL WINAPI VirtualLinkDirectoryStatic(LPCWSTR source, LPCWSTR destination, unsi
std::string nameU8 = ush::string_cast<std::string>(
file.fileName.c_str(), ush::CodePage::UTF8);

if (bfs::path(nameU8).extension() == ".mohidden") {
continue;
}

// TODO could save memory here by storing only the file name for the
// source and constructing the full name using the parent directory
context->redirectionTable().addFile(
Expand Down