Skip to content

Commit b989d70

Browse files
authored
GIT_SUBMODULE fix: File not found .git/HEAD error (#168)
* Fix File not found .git/HEAD error * Verify if git path output is absolute
1 parent 299a48f commit b989d70

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmake/modules/hunter_pack_git_submodule.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ function(hunter_pack_git_submodule)
139139
endif()
140140

141141
set(head_file "${output}")
142+
if(NOT IS_ABSOLUTE "${head_file}")
143+
set(head_file "${submodule_dir}/${head_file}")
144+
endif()
142145
if(NOT EXISTS "${head_file}")
143146
hunter_internal_error("File not found: '${head_file}'")
144147
endif()
@@ -182,6 +185,9 @@ function(hunter_pack_git_submodule)
182185
endif()
183186

184187
set(ref_file "${output}")
188+
if(NOT IS_ABSOLUTE "${ref_file}")
189+
set(ref_file "${submodule_dir}/${ref_file}")
190+
endif()
185191
if(NOT EXISTS "${ref_file}")
186192
hunter_internal_error("File not found: ${ref_file}")
187193
endif()

0 commit comments

Comments
 (0)