Apparently some git tools (such as "repo") may not create this file.
Patch by Quentin Neill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301565
91177308-0d34-0410-b5e6-
96231b3b80d8
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