There is a slight bug in the commit_reader introduced in #13673 whereby commit messages which have a final unterminated line miss their final line. This PR fixes this. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
3260e15668
commit
e4567d4285
1 changed files with 5 additions and 1 deletions
|
@ -36,6 +36,10 @@ readLoop:
|
||||||
line, err := bufReader.ReadBytes('\n')
|
line, err := bufReader.ReadBytes('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
|
if message {
|
||||||
|
_, _ = messageSB.Write(line)
|
||||||
|
}
|
||||||
|
_, _ = payloadSB.Write(line)
|
||||||
break readLoop
|
break readLoop
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -86,10 +90,10 @@ readLoop:
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_, _ = messageSB.Write(line)
|
_, _ = messageSB.Write(line)
|
||||||
|
_, _ = payloadSB.Write(line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commit.CommitMessage = messageSB.String()
|
commit.CommitMessage = messageSB.String()
|
||||||
_, _ = payloadSB.WriteString(commit.CommitMessage)
|
|
||||||
commit.Signature = &CommitGPGSignature{
|
commit.Signature = &CommitGPGSignature{
|
||||||
Signature: signatureSB.String(),
|
Signature: signatureSB.String(),
|
||||||
Payload: payloadSB.String(),
|
Payload: payloadSB.String(),
|
||||||
|
|
Loading…
Reference in a new issue