mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 12:00:40 +00:00
parent
44895fa4a2
commit
9d69abc45a
@ -202,7 +202,17 @@ func (p MessageProcessorImpl) Format(msg CommitMessage) (string, string, string)
|
||||
|
||||
// Parse a commit message.
|
||||
func (p MessageProcessorImpl) Parse(subject, body string) CommitMessage {
|
||||
commitType, scope, description, hasBreakingChange := parseSubjectMessage(subject)
|
||||
|
||||
filteredSubject := subject
|
||||
if p.messageCfg.MessageSelector != "" {
|
||||
subjectRegex := regexp.MustCompile(p.messageCfg.MessageSelector)
|
||||
subjectMessageIndex := regex.SubexpIndex("message")
|
||||
subjectMatch := regex.FindStringSubmatch(subject)
|
||||
|
||||
filteredSubject = subjectMatch[subjectMessageIndex]
|
||||
}
|
||||
|
||||
commitType, scope, description, hasBreakingChange := parseSubjectMessage(filteredSubject)
|
||||
|
||||
metadata := make(map[string]string)
|
||||
for key, mdCfg := range p.messageCfg.Footer {
|
||||
|
Loading…
Reference in New Issue
Block a user