Execute cdUp always

Description: In Debug mode the asserts are activated, but in Release mode not. In this case in the release build the cdUp will just be ignored.
This commit is contained in:
Martin Marmsoler 2024-02-13 20:38:24 +01:00
parent fbb4867afa
commit 00a9ad1a20

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;
}