HTTPDirectory* childDirectory(const std::string& name)
{
- return _repository->getOrCreateDirectory(relativePath() + "/" + name);
+ std::string childPath = relativePath().empty() ? name : relativePath() + "/" + name;
+ return _repository->getOrCreateDirectory(childPath);
}
void removeOrphans(const string_list& orphans)
repoPath = repoPath.substr(0, suffix);
}
+ if (repoPath.find("/") == 0) { // trim leading /
+ repoPath = repoPath.substr(1);
+ }
+
TestRepoEntry* entry = global_repo->findEntry(repoPath);
if (!entry) {
sendErrorResponse(404, false, "unknown repo path:" + repoPath);