refs #11993 - error out in `TestFileLister::recursiveAddFiles()` instead of looping infinitely when repository root directory is not found (#5462)

Not a proper fix yet but at least it prevents the hang and gives some
feedback.
This commit is contained in:
Oliver Stöneberg 2023-09-20 10:49:00 +02:00 committed by GitHub
parent a43b55a0ca
commit 21e001cd1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -43,7 +43,11 @@ private:
static std::string findBaseDir() {
std::string basedir;
while (!Path::isDirectory(Path::join(basedir, ".github"))) {
const std::string abspath = Path::getAbsoluteFilePath(basedir);
basedir += "../";
// no more going up
if (Path::getAbsoluteFilePath(basedir) == abspath)
throw std::runtime_error("could not find repository root directory");
}
return basedir;
}