From 1b43f8b14d05e8fc12f520845c1b5228511ad5bd Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Tue, 1 Jun 2021 10:00:45 +0200
Subject: [PATCH] Fix build system when using the release tar file

The clang_format check needs the .git rpository to be present. In the release
tar file the directory is missing which results in a crash when running cmake.
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20f1194e71..fe06247bc3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -414,7 +414,7 @@ add_custom_target(cleantest
                  )
 
 find_package2(PRIVATE ClangFormat)
-if(ClangFormat_FOUND)
+if(ClangFormat_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
   if (FAIRROOT_FORMAT_BASE)
     set(BASE_COMMIT ${FAIRROOT_FORMAT_BASE})
   else()
-- 
GitLab