1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

cmake: Touch $GIT_DIR/logs/HEAD if it does not already exist.

Apparently some git tools (such as "repo") may not create this file.
Patch by Quentin Neill.

llvm-svn: 301565
This commit is contained in:
Peter Collingbourne 2017-04-27 17:04:05 +00:00
parent 0cccf42c4a
commit d964add08d

View File

@ -18,6 +18,10 @@ macro(find_first_existing_vc_file out_var path)
if(git_result EQUAL 0)
string(STRIP "${git_dir}" git_dir)
set(${out_var} "${git_dir}/logs/HEAD")
# some branchless cases (e.g. 'repo') may not yet have .git/logs/HEAD
if (NOT EXISTS "${git_dir}/logs/HEAD")
file(WRITE "${git_dir}/logs/HEAD" "")
endif()
else()
find_first_existing_file(${out_var}
"${path}/.svn/wc.db" # SVN 1.7