Fix error when getting the commit time fails

While this should work, allow the build to succeed if for some reason the command fails.
This commit is contained in:
Campbell Barton 2015-07-19 09:51:49 +10:00
parent 4bca8a6bc5
commit 1e10e4e2e3
1 changed files with 4 additions and 0 deletions

View File

@ -97,6 +97,10 @@ if(EXISTS ${SOURCE_DIR}/.git)
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
# May fail in rare cases
if(MY_WC_COMMIT_TIMESTAMP STREQUAL "")
set(MY_WC_COMMIT_TIMESTAMP 0)
endif()
# Update GIT index before getting dirty files
execute_process(COMMAND git update-index -q --refresh