[Cmake-commits] CMake branch, next, updated. v3.8.0-rc4-663-ge6f1d03

Kitware Robot kwrobot at kitware.com
Mon Apr 3 14:45:04 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e6f1d0366f459cfe51a7f855c26530502954ca35 (commit)
       via  12a781301c41f187b8d91ffd4461820c42bdaf5a (commit)
      from  38ed6b3da769f4c08fc6cdd96d588e2f575d5e4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6f1d0366f459cfe51a7f855c26530502954ca35
commit e6f1d0366f459cfe51a7f855c26530502954ca35
Merge: 38ed6b3 12a7813
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 3 18:39:53 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Apr 3 14:39:58 2017 -0400

    Stage topic 'ExternalProject-checkout-clarify'
    
    Topic-id: 23463
    Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/660


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12a781301c41f187b8d91ffd4461820c42bdaf5a
commit 12a781301c41f187b8d91ffd4461820c42bdaf5a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 3 14:34:35 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 3 14:34:35 2017 -0400

    ExternalProject: Run `git checkout` with `--` to clarify arguments
    
    Fix the case when the tag name to be checked out also happens to match a
    path name.  Unfortunately we cannot do this for Git versions prior to
    1.8.5 because they do not "do what I mean" to checkout remote branches
    when the `--` argument is given.
    
    Fixes: #16678

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 34dc98c..b812845 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -531,6 +531,15 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git
   else()
     set(git_clone_shallow_options "--depth 1")
   endif()
+  if(NOT GIT_VERSION_STRING VERSION_LESS 1.8.5)
+    # Use `git checkout <tree-ish> --` to avoid ambiguity with a local path.
+    set(git_checkout_explicit-- "--")
+  else()
+    # Use `git checkout <branch>` even though this risks ambiguity with a
+    # local path.  Unfortunately we cannot use `git checkout <tree-ish> --`
+    # because that will not search for remote branch names, a common use case.
+    set(git_checkout_explicit-- "")
+  endif()
   file(WRITE ${script_filename}
 "if(\"${git_tag}\" STREQUAL \"\")
   message(FATAL_ERROR \"Tag for git checkout should not be empty.\")
@@ -600,11 +609,8 @@ if(error_code)
   message(FATAL_ERROR \"Failed to clone repository: '${git_repository}'\")
 endif()
 
-# Use `git checkout <branch>` even though this risks ambiguity with a
-# local path.  Unfortunately we cannot use `git checkout <tree-ish> --`
-# because that will not search for remote branch names, a common use case.
 execute_process(
-  COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag}
+  COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag} ${git_checkout_explicit--}
   WORKING_DIRECTORY \"${work_dir}/${src_name}\"
   RESULT_VARIABLE error_code
   )

-----------------------------------------------------------------------

Summary of changes:
 Modules/ExternalProject.cmake |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list