Skip to content

Commit

Permalink
Merge pull request #695 from Murmele/dotGitError
Browse files Browse the repository at this point in the history
Execute cdUp always
  • Loading branch information
Murmele authored Feb 13, 2024
2 parents fbb4867 + 00a9ad1 commit dad3383
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/git/Repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dad3383

Please sign in to comment.