CTest: Parse empty Git commits correctly

Git's diff-tree format has no '\n'-terminated blank line at the end of
its commit message body block if there are no diff lines.  Instead the
message body is terminated by '\0' and there is no diff section.  Teach
CTest to parse the format in this case.
This commit is contained in:
Brad King
2010-06-23 09:14:43 -04:00
parent b141862564
commit bbfe241c6a
4 changed files with 32 additions and 4 deletions
+4 -2
View File
@@ -44,7 +44,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp,
//----------------------------------------------------------------------------
cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR):
Separator(sep), IgnoreCR(ignoreCR), Log(0), Prefix(0)
Separator(sep), IgnoreCR(ignoreCR), Log(0), Prefix(0), LineEnd('\0')
{
}
@@ -61,8 +61,10 @@ bool cmProcessTools::LineParser::ProcessChunk(const char* first, int length)
const char* last = first + length;
for(const char* c = first; c != last; ++c)
{
if(*c == this->Separator)
if(*c == this->Separator || *c == '\0')
{
this->LineEnd = *c;
// Log this line.
if(this->Log && this->Prefix)
{