summaryrefslogtreecommitdiffstats
path: root/Tests/CTestUpdateGIT.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-07-26 15:40:20 (GMT)
committerBrad King <brad.king@kitware.com>2010-07-26 15:40:20 (GMT)
commit7bf8dc1ac9d2c2430e247c2cfb54a6a4cb5f698a (patch)
treef2c0e4aabf72c38adde8c258bc29cd1be57a1af9 /Tests/CTestUpdateGIT.cmake.in
parent65cb72f7583a25bd3bec3f6a41a7a71cffa44ee2 (diff)
downloadCMake-7bf8dc1ac9d2c2430e247c2cfb54a6a4cb5f698a.zip
CMake-7bf8dc1ac9d2c2430e247c2cfb54a6a4cb5f698a.tar.gz
CMake-7bf8dc1ac9d2c2430e247c2cfb54a6a4cb5f698a.tar.bz2
ctest_update: Support ".git file" work trees
Commit c3781efb (Support Git upstream branch rewrites, 2010-06-08) assumed that ".git/FETCH_HEAD" exists inside the source tree. Fix the implementation to handle a work tree using a ".git file" to link to its repository. Use "git rev-parse --git-dir" to locate the real .git dir.
Diffstat (limited to 'Tests/CTestUpdateGIT.cmake.in')
-rw-r--r--Tests/CTestUpdateGIT.cmake.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 4ac1b31..e1d345c 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -259,6 +259,11 @@ execute_process(
WORKING_DIRECTORY \"${TOP}\"
COMMAND \"${GIT}\" clone \"${REPO}\" dash-source
)
+
+# Test .git file.
+file(RENAME \"${TOP}/dash-source/.git\" \"${TOP}/dash-source/repo.git\")
+file(WRITE \"${TOP}/dash-source/.git\" \"gitdir: repo.git\n\")
+
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"
COMMAND \"${GIT}\" reset --hard master~2