Fix repository test.
This commit is contained in:
parent
f21eac8473
commit
b862cf7e54
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user