diff options
author | Brad King <brad.king@kitware.com> | 2010-07-20 20:57:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-07-20 20:57:50 (GMT) |
commit | 65cb72f7583a25bd3bec3f6a41a7a71cffa44ee2 (patch) | |
tree | 426a39a2e88d41fc116f341262e7046dbcedba9e /Source/CTest/cmCTestGIT.cxx | |
parent | c3781efb28a35f54ed6306354330734994f2c8b1 (diff) | |
download | CMake-65cb72f7583a25bd3bec3f6a41a7a71cffa44ee2.zip CMake-65cb72f7583a25bd3bec3f6a41a7a71cffa44ee2.tar.gz CMake-65cb72f7583a25bd3bec3f6a41a7a71cffa44ee2.tar.bz2 |
ctest_update: Abort if Git FETCH_HEAD has no candidates
If .git/FETCH_HEAD provides no merge candidate do not attempt to update.
Also log FETCH_HEAD lines as we parse them since they are essentially
output from the git fetch command.
Diffstat (limited to 'Source/CTest/cmCTestGIT.cxx')
-rw-r--r-- | Source/CTest/cmCTestGIT.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 6c3631c..41c1393 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -126,6 +126,7 @@ bool cmCTestGIT::UpdateByFetchAndReset() std::string line; while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line)) { + this->Log << "FETCH_HEAD> " << line << "\n"; if(line.find("\tnot-for-merge\t") == line.npos) { std::string::size_type pos = line.find('\t'); @@ -135,6 +136,11 @@ bool cmCTestGIT::UpdateByFetchAndReset() } } } + if(sha1.empty()) + { + this->Log << "FETCH_HEAD has no upstream branch candidate!\n"; + return false; + } } // Reset the local branch to point at that tracked from upstream. |