ExternalProject: regression in remote branch checkout
The following MWE will work on 3.7 but not 3.8rc4:
```cmake
cmake_minimum_required(VERSION 3.7.0)
project(Foo)
include(ExternalProject)
ExternalProject_Add(gitTest
GIT_REPOSITORY https://github.com/githubtraining/hellogitworld.git
GIT_TAG bisect
CONFIGURE_COMMAND ""
BUILD_COMMAND echo "Built"
INSTALL_COMMAND ""
TEST_COMMAND ""
)
```
The problem is the addition of `--` after the branch name in the git checkout command in `gitTest-prefix/tmp/gitTest-gitclone.cmake` only in 3.8; this is trying to be smart and not clash with a file name, but it also changes the behavior of the git command when you are trying to get a branch that does not exist locally in your cloned repository (i.e., any branch other than master). In this case, `git checkout bisect` works as expected but `git checkout bisect --` fails miserably because `bisect` doesn't refer to a local branch.
(I don't like that git behavior personally, but that's the way it works)
issue