Fix repository test.
This commit is contained in:
@@ -405,7 +405,8 @@ public:
|
|||||||
|
|
||||||
HTTPDirectory* childDirectory(const std::string& name)
|
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)
|
void removeOrphans(const string_list& orphans)
|
||||||
|
|||||||
@@ -256,6 +256,10 @@ public:
|
|||||||
repoPath = repoPath.substr(0, suffix);
|
repoPath = repoPath.substr(0, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (repoPath.find("/") == 0) { // trim leading /
|
||||||
|
repoPath = repoPath.substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
TestRepoEntry* entry = global_repo->findEntry(repoPath);
|
TestRepoEntry* entry = global_repo->findEntry(repoPath);
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
sendErrorResponse(404, false, "unknown repo path:" + repoPath);
|
sendErrorResponse(404, false, "unknown repo path:" + repoPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user