ExternalProject git checkout fails when tag name matches path name
ExternalProject fails when the GIT_TAG matches a directory name in the repo being checked out. For example:
[ 44%] Performing update step for 'aaa'
fatal: ambiguous argument 'bbb': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Current branch bbb is up to date.
The following patch fixed it for me. I didn't look to see if other places needed a --
separator.
--- /usr/share/cmake-3.6/Modules/ExternalProject.cmake 2016-09-07 09:11:58.000000000 -0500
+++ ExternalProject.cmake-3.6 2016-09-23 12:50:09.153230047 -0500
@@ -573,7 +573,7 @@
endif()
execute_process(
- COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag}
+ COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag} --
WORKING_DIRECTORY \"${work_dir}/${src_name}\"
RESULT_VARIABLE error_code
)