-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from fcharlie/patch-1
Fix decoding panic caused by commit with invalid continuation line before extra headers.
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -455,3 +455,17 @@ func TestCommitEqualReturnsTrueWhenBothCommitsAreNil(t *testing.T) { | |
|
||
assert.True(t, c1.Equal(c2)) | ||
} | ||
|
||
func TestCommitInvalidMultilineNonExtraHeader(t *testing.T) { | ||
cc := `tree 2aedfd35087c75d17bdbaf4dd56069d44fc75b71 | ||
parent 75158117eb8efe60453f8c077527ac3530c81e38 | ||
author Jane Doe <[email protected]> 1503956287 -0400 | ||
committer Jane Doe <[email protected]> 1503956287 -0400 | ||
foo bar | ||
initial commit` | ||
|
||
var c Commit | ||
_, err := c.Decode(sha1.New(), strings.NewReader(cc), int64(len(cc))) | ||
assert.NoError(t, err) | ||
} |