From efe06dd0d315c4add52ab7e0b8c4c95d084e7a50 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Tue, 10 Sep 2019 16:33:44 -0400 Subject: [PATCH] Skip empty excludes This is useful when you want to append additional elements to the env var in the fasion of `PATH=$PATH:/things`. Signed-off-by: Michael Crosby --- git/commits.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git/commits.go b/git/commits.go index 2f985cf..52af997 100644 --- a/git/commits.go +++ b/git/commits.go @@ -108,6 +108,9 @@ func Check(commit string) ([]byte, error) { if gitNewEnough { excludeList := strings.Split(excludeEnvList, ":") for _, exclude := range excludeList { + if exclude == "" { + continue + } args = append(args, "--", ".", fmt.Sprintf(":(exclude)%s", exclude)) } }