From b08d10693378a724230ecf2ad75c2a757cf7edca Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Thu, 18 Jun 2020 22:53:43 +0800 Subject: [PATCH] cmake: update git command args (#293) --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index efd76d2..f08fc00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,7 @@ set(PROJECT_VERSION "1.6.0") find_package(Git) if(GIT_FOUND) execute_process( - COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMAND ${GIT_EXECUTABLE} --git-dir ${CMAKE_CURRENT_SOURCE_DIR}/.git rev-parse --short HEAD RESULT_VARIABLE GIT_RET OUTPUT_VARIABLE GIT_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE -- 2.43.4