Skip to content

Commit 48acb1a

Browse files
authored
Merge pull request #34 from kunalkushwaha/multiple-exclude-pathspec
added support for multiple path in exclude list
2 parents 3dbd244 + 400b685 commit 48acb1a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

git/commits.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ func Check(commit string) ([]byte, error) {
6666
"--no-pager", "log", "--check",
6767
fmt.Sprintf("%s^..%s", commit, commit),
6868
}
69-
if exclude := os.Getenv("GIT_CHECK_EXCLUDE"); exclude != "" {
70-
args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude))
69+
if excludeEnvList := os.Getenv("GIT_CHECK_EXCLUDE"); excludeEnvList != "" {
70+
excludeList := strings.Split(excludeEnvList, ":")
71+
for _, exclude := range excludeList {
72+
args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude))
73+
}
7174
}
7275
cmd := exec.Command("git", args...)
7376
if debug() {

0 commit comments

Comments
 (0)