mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 14:23:10 -05:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user