CMake: ignore git stderr when trying to sort out revision. NFC.

llvm-svn: 301650
This commit is contained in:
Tim Northover 2017-04-28 16:06:00 +00:00
parent 919f9e8d65
commit 65e448422c
2 changed files with 4 additions and 2 deletions

View File

@ -45,7 +45,8 @@ function(add_version_info_from_vcs VERS)
WORKING_DIRECTORY ${SOURCE_DIR}
TIMEOUT 5
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_output)
OUTPUT_VARIABLE git_output
ERROR_QUIET)
if( git_result EQUAL 0 )
string(REGEX MATCH "URL: ([^ \n]*)" svn_url ${git_output})
if(svn_url)

View File

@ -14,7 +14,8 @@ macro(find_first_existing_vc_file out_var path)
execute_process(COMMAND ${git_executable} rev-parse --git-dir
WORKING_DIRECTORY ${path}/cmake
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_dir)
OUTPUT_VARIABLE git_dir
ERROR_QUIET)
if(git_result EQUAL 0)
string(STRIP "${git_dir}" git_dir)
set(${out_var} "${git_dir}/logs/HEAD")