1
0
Fork 0
mirror of https://github.com/vbatts/git-validation.git synced 2024-11-22 16:15:40 +00:00

support for multiple path in exclude list

delimeter should be used as colon(:)

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
This commit is contained in:
Kunal Kushwaha 2018-03-06 15:48:24 +09:00
parent 3dbd244e43
commit 400b685c66

View file

@ -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() {