Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cmake/macro_aspect_query_git_information.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ macro(ASPECT_QUERY_GIT_INFORMATION)
if (EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD)
# A normal git repository
set(_head_location ${CMAKE_SOURCE_DIR}/.git/HEAD)
else()
# Likely a git worktree: Read .git file, which has the format "gitdir: <absolute path>"
file(STRINGS ${CMAKE_SOURCE_DIR}/.git _gitdir LIMIT_COUNT 1)
string(REGEX REPLACE "gitdir: " "" _gitdir ${_gitdir})
if(EXISTS ${_gitdir}/HEAD)
set(_head_location ${_gitdir}/HEAD)
endif()
else()
# Likely a git worktree: Read .git file, which has the format "gitdir: <absolute path>"
file(STRINGS ${CMAKE_SOURCE_DIR}/.git _gitdir LIMIT_COUNT 1)
string(REGEX REPLACE "gitdir: " "" _gitdir ${_gitdir})
if(EXISTS ${_gitdir}/HEAD)
set(_head_location ${_gitdir}/HEAD)
endif()
endif()
endif()

Expand Down