summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-06-24 14:41:20 (GMT)
committerBrad King <brad.king@kitware.com>2010-06-24 14:41:20 (GMT)
commit566bb2d0789b5ad8c65337eaee39c92e9a797608 (patch)
tree8ef833379f1add5a594c546197597ff09467e40d /Tests
parentb86a551edee8d061989c4b2c25bdd09e5f9d3dec (diff)
parentbbfe241c6a4386a39ebb93cdb70a8390eab14eef (diff)
downloadCMake-566bb2d0789b5ad8c65337eaee39c92e9a797608.zip
CMake-566bb2d0789b5ad8c65337eaee39c92e9a797608.tar.gz
CMake-566bb2d0789b5ad8c65337eaee39c92e9a797608.tar.bz2
Merge branch 'ctest-git-empty-commits'
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CTestUpdateGIT.cmake.in20
1 files changed, 18 insertions, 2 deletions
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 4ac1b31..f672a52 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -131,6 +131,22 @@ run_child(
COMMAND ${GIT} submodule update
)
+# Save the first revision name.
+execute_process(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${GIT} rev-parse HEAD
+ OUTPUT_VARIABLE revision1
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+#-----------------------------------------------------------------------------
+# Create an empty commit.
+message("Creating empty commit...")
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${GIT} commit --allow-empty -m "Empty commit"
+ )
+
#-----------------------------------------------------------------------------
# Make changes in the working tree.
message("Changing content...")
@@ -196,7 +212,7 @@ macro(rewind_source src_dir)
message("Backing up to revision 1...")
run_child(
WORKING_DIRECTORY ${TOP}/${src_dir}
- COMMAND ${GIT} reset --hard origin/master~2
+ COMMAND ${GIT} reset --hard ${revision1}
)
run_child(
WORKING_DIRECTORY ${TOP}/${src_dir}
@@ -261,7 +277,7 @@ execute_process(
)
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"
- COMMAND \"${GIT}\" reset --hard master~2
+ COMMAND \"${GIT}\" reset --hard ${revision1}
)
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"