mirror of
https://github.com/vbatts/git-validation.git
synced 2024-11-29 03:25:39 +00:00
Merge pull request #34 from kunalkushwaha/multiple-exclude-pathspec
added support for multiple path in exclude list
This commit is contained in:
commit
48acb1add0
1 changed files with 5 additions and 2 deletions
|
@ -66,8 +66,11 @@ func Check(commit string) ([]byte, error) {
|
||||||
"--no-pager", "log", "--check",
|
"--no-pager", "log", "--check",
|
||||||
fmt.Sprintf("%s^..%s", commit, commit),
|
fmt.Sprintf("%s^..%s", commit, commit),
|
||||||
}
|
}
|
||||||
if exclude := os.Getenv("GIT_CHECK_EXCLUDE"); exclude != "" {
|
if excludeEnvList := os.Getenv("GIT_CHECK_EXCLUDE"); excludeEnvList != "" {
|
||||||
args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude))
|
excludeList := strings.Split(excludeEnvList, ":")
|
||||||
|
for _, exclude := range excludeList {
|
||||||
|
args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cmd := exec.Command("git", args...)
|
cmd := exec.Command("git", args...)
|
||||||
if debug() {
|
if debug() {
|
||||||
|
|
Loading…
Reference in a new issue