Rework policies to return branches rather than path strings

This commit is contained in:
trapexit 2025-05-17 16:35:18 -05:00 • committed by GitHub
parent 7e084ea7db
commit 86b50d2d4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
86 changed files with 1259 additions and 3088 deletions

View file

@ -81,16 +81,16 @@ namespace l
static
int
rmdir_loop(const StrVec &basepaths_,
const char *fusepath_,
const FollowSymlinks followsymlinks_)
rmdir_loop(const std::vector<Branch*> &branches_,
const char *fusepath_,
const FollowSymlinks followsymlinks_)
{
int error;
error = 0;
for(size_t i = 0, ei = basepaths_.size(); i != ei; i++)
for(auto &branch : branches_)
{
error = l::rmdir_core(basepaths_[i],fusepath_,followsymlinks_,error);
error = l::rmdir_core(branch->path,fusepath_,followsymlinks_,error);
}
return -error;
@ -104,13 +104,13 @@ namespace l
const char *fusepath_)
{
int rv;
vector<string> basepaths;
std::vector<Branch*> branches;
rv = actionFunc_(branches_,fusepath_,&basepaths);
rv = actionFunc_(branches_,fusepath_,branches);
if(rv == -1)
return -errno;
return l::rmdir_loop(basepaths,fusepath_,followsymlinks_);
return l::rmdir_loop(branches,fusepath_,followsymlinks_);
}
}