2nd try at issue #874.

The problem from issue #874 has another variant:
If .git/logs/refs/heads/merge-2.067 exists then this ref is
returned as hash value(!). This is plain wrong. Solution is
again to look up `.git/packed-refs`.
This commit is contained in:
Kai Nacke 2015-03-28 19:01:48 +01:00
parent 3a6d7bad96
commit 7c835c2738

View file

@ -23,9 +23,6 @@ if(HEAD_CONTENTS MATCHES "ref")
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
set(HEAD_HASH "${HEAD_REF}")
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)