Fix repository test.

This commit is contained in:
James Turner 2016-07-01 09:02:52 +01:00
parent f21eac8473
commit b862cf7e54
2 changed files with 6 additions and 1 deletions

View File

@ -405,7 +405,8 @@ public:
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)

View File

@ -256,6 +256,10 @@ public:
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);