Merge pull request #695 from Murmele/dotGitError

Execute cdUp always
This commit is contained in:
Murmele 2024-02-13 21:11:47 +01:00 committed by GitHub
commit dad3383b39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -156,7 +156,11 @@ QDir Repository::dir(bool includeGitFolder) const {
QDir dir(git_repository_path(d->repo));
if (!includeGitFolder) {
assert(dir.dirName() == ".git");
assert(dir.cdUp());
if (!dir.cdUp()) {
assert(false); // must be done explicit, because in release build the
// assert will not be executed, so assert(dir.cdUp()) does
// not work in release build
}
}
return dir;
}