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.
This commit is contained in:
parent
c3781efb28
commit
65cb72f758
|
@ -126,6 +126,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
|
||||||
std::string line;
|
std::string line;
|
||||||
while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line))
|
while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line))
|
||||||
{
|
{
|
||||||
|
this->Log << "FETCH_HEAD> " << line << "\n";
|
||||||
if(line.find("\tnot-for-merge\t") == line.npos)
|
if(line.find("\tnot-for-merge\t") == line.npos)
|
||||||
{
|
{
|
||||||
std::string::size_type pos = line.find('\t');
|
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.
|
// Reset the local branch to point at that tracked from upstream.
|
||||||
|
|
Loading…
Reference in New Issue