From 00a9ad1a20aa3e66f32ff3f767982578e946bff7 Mon Sep 17 00:00:00 2001 From: Martin Marmsoler Date: Tue, 13 Feb 2024 20:38:24 +0100 Subject: [PATCH] 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. --- src/git/Repository.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/git/Repository.cpp b/src/git/Repository.cpp index 3004501d..8c639fe9 100644 --- a/src/git/Repository.cpp +++ b/src/git/Repository.cpp @@ -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; }