feat(flag): --path filtering - refs (#62). Closes #35

* Argument: --path filtering - refs #35
* Minor documentation additions for Paths option
This commit is contained in:
Mikael Fridh 2021-03-12 13:57:00 +01:00 committed by GitHub
parent a1c84d7a0d
commit 9d62af2943
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 5 deletions

View file

@ -86,12 +86,20 @@ func newCommitParser(logger *Logger, client gitcmd.Client, jiraClient JiraClient
}
func (p *commitParser) Parse(rev string) ([]*Commit, error) {
out, err := p.client.Exec(
"log",
paths := p.config.Options.Paths
args := []string{
rev,
"--no-decorate",
"--pretty="+logFormat,
)
"--pretty=" + logFormat,
}
if len(paths) > 0 {
args = append(args, "--")
args = append(args, paths...)
}
out, err := p.client.Exec("log", args...)
if err != nil {
return nil, err