From d165ea884a56229be12eb81b2689210b64362b6e Mon Sep 17 00:00:00 2001 From: tsuyoshiwada Date: Sun, 25 Feb 2018 01:10:36 +0900 Subject: [PATCH] fix: Fix a bug that `Commit.Revert.Header` is not converted by `GitHubProcessor` --- processor.go | 6 ++++++ processor_test.go | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/processor.go b/processor.go index 5fef2dae..f86d4e8c 100644 --- a/processor.go +++ b/processor.go @@ -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 } diff --git a/processor_test.go b/processor_test.go index 68a0a2a8..5c589f49 100644 --- a/processor_test.go +++ b/processor_test.go @@ -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", + }, + }, + ), + ) }