Don't assume .git exists just because git is installed.

find_package(Git) is done in SearchForStuff it could be deleted over there
but it fits better there. The only thing this line did was saying git was
not found for a second time since if it was found then it never triggered.
.
Check for the existance of .git to avoid
fatal: Not a git repository (or any of the parent directories): .git
This commit is contained in:
Miguel A. Colón Vélez 2015-01-06 21:14:10 -05:00
parent e0add8003d
commit f392493245
1 changed files with 1 additions and 2 deletions

View File

@ -37,9 +37,8 @@ function(detectOperatingSystem)
endfunction()
function(write_svnrev_h)
find_package(Git)
set(PCSX2_WC_TIME 0)
if (GIT_FOUND)
if (GIT_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.git)
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} show -s --format=%ci HEAD
OUTPUT_VARIABLE PCSX2_WC_TIME
OUTPUT_STRIP_TRAILING_WHITESPACE)