Skip to content

Commit

Permalink
cmake: Touch $GIT_DIR/logs/HEAD if it does not already exist.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pcc committed Apr 27, 2017
1 parent dbf2bf7 commit 5cb8f64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/llvm/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cb8f64

Please sign in to comment.