summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestGIT.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-02-28 16:52:30 (GMT)
committerBrad King <brad.king@kitware.com>2013-02-28 16:52:30 (GMT)
commit78b81b773c428b6575ea50369a96e26fdfa586df (patch)
treec21df3b639ae2339b83d5a86728866a7df490ea0 /Source/CTest/cmCTestGIT.cxx
parent42c56c824c719a640471a622f710b0b86ee02abc (diff)
downloadCMake-78b81b773c428b6575ea50369a96e26fdfa586df.zip
CMake-78b81b773c428b6575ea50369a96e26fdfa586df.tar.gz
CMake-78b81b773c428b6575ea50369a96e26fdfa586df.tar.bz2
CTest: Fix ctest_update with 'HEAD' file in source tree
Add the '--' command-line separator to make the HEAD reference unambiguous. Extend the CTest.UpdateGIT test to cover this case.
Diffstat (limited to 'Source/CTest/cmCTestGIT.cxx')
-rw-r--r--Source/CTest/cmCTestGIT.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 2c1a0af..5b34491 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -68,7 +68,7 @@ std::string cmCTestGIT::GetWorkingRevision()
{
// Run plumbing "git rev-list" to get work tree revision.
const char* git = this->CommandLineTool.c_str();
- const char* git_rev_list[] = {git, "rev-list", "-n", "1", "HEAD", 0};
+ const char* git_rev_list[] = {git, "rev-list", "-n", "1", "HEAD", "--", 0};
std::string rev;
OneLineParser out(this, "rl-out> ", rev);
OutputLogger err(this->Log, "rl-err> ");
@@ -639,7 +639,7 @@ void cmCTestGIT::LoadModifications()
this->RunChild(git_update_index, &ui_out, &ui_err);
// Use 'git diff-index' to get modified files.
- const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", 0};
+ const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", "--", 0};
DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> ");
this->RunChild(git_diff_index, &out, &err);