From 400b685c663fa70d5c2d84c3ba12ff9e86db372c Mon Sep 17 00:00:00 2001 From: Kunal Kushwaha Date: Tue, 6 Mar 2018 15:48:24 +0900 Subject: [PATCH] support for multiple path in exclude list delimeter should be used as colon(:) Signed-off-by: Kunal Kushwaha --- git/commits.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git/commits.go b/git/commits.go index 8621c06..ac0592a 100644 --- a/git/commits.go +++ b/git/commits.go @@ -66,8 +66,11 @@ func Check(commit string) ([]byte, error) { "--no-pager", "log", "--check", fmt.Sprintf("%s^..%s", commit, commit), } - if exclude := os.Getenv("GIT_CHECK_EXCLUDE"); exclude != "" { - args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude)) + if excludeEnvList := os.Getenv("GIT_CHECK_EXCLUDE"); excludeEnvList != "" { + excludeList := strings.Split(excludeEnvList, ":") + for _, exclude := range excludeList { + args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude)) + } } cmd := exec.Command("git", args...) if debug() {