fix: Fix a bug that Commit.Revert.Header is not converted by GitHubProcessor

This commit is contained in:
tsuyoshiwada 2018-02-25 01:10:36 +09:00
parent 8780cd1244
commit d165ea884a
2 changed files with 21 additions and 0 deletions

View file

@ -42,9 +42,15 @@ func (p *GitHubProcessor) ProcessCommit(commit *Commit) *Commit {
commit.Header = p.addLinks(commit.Header)
commit.Subject = p.addLinks(commit.Subject)
commit.Body = p.addLinks(commit.Body)
for _, note := range commit.Notes {
note.Body = p.addLinks(note.Body)
}
if commit.Revert != nil {
commit.Revert.Header = p.addLinks(commit.Revert.Header)
}
return commit
}

View file

@ -51,4 +51,19 @@ gh-56 hoge fuga`,
},
),
)
assert.Equal(
&Commit{
Revert: &Revert{
Header: "revert header [@mention](https://github.com/mention) [#123](https://example.com/issues/123)",
},
},
processor.ProcessCommit(
&Commit{
Revert: &Revert{
Header: "revert header @mention #123",
},
},
),
)
}