Fix branch snapshot lifetime in EXDEV link fallback

This commit is contained in:
Antonio SJ Musumeci 2026-11-06 12:10:05 -06:00
parent b0d344308d
commit ecb4de5bc0
2 changed files with 5 additions and 1 deletions

View file

@ -306,7 +306,8 @@ _link_exdev(const fs::path &oldpath_,
return -EXDEV;
}
rv = (*sourcePolicy)(cfg.branches,oldpath_,oldbranches);
const Branches::Ptr branches = cfg.branches;
rv = (*sourcePolicy)(branches,oldpath_,oldbranches);
if(rv < 0)
return rv;
if(oldbranches.empty())