func IsCommitError(commit, commitErrorIndicator string) bool {
	return commit == commitErrorIndicator
}
IsCommitError returns true if the commit string equals the error indicator
package utils
import (
	"log"
	"regexp"
	"strings"
	"gopkg.in/src-d/go-git.v4/plumbing/object"
	git "gopkg.in/src-d/go-git.v4"
	"gopkg.in/src-d/go-git.v4/plumbing"
)
func GetBuildTypeByPathFilters(defaultType string, changedPaths, pathFilter []string, allowMultipleTypes bool) string {
	if len(changedPaths) == 0 {
		return defaultType
	}
	changedPathsPerFilter, changedPathsPerFilterCount := CountLinesPerPathFilter(pathFilter, changedPaths)
	if changedPathsPerFilterCount != len(changedPaths) {
		return defaultType
	}
	multipleTypes := ""
	for bt, btPathCount := range changedPathsPerFilter {
		if (!strings.Contains(multipleTypes, bt)) && (btPathCount != 0) {
			multipleTypes = multipleTypes + bt + ";"
		}
	}
	multipleTypes = strings.TrimRight(multipleTypes, ";")
	if (allowMultipleTypes == false) && (strings.Contains(multipleTypes, ";")) {
		return defaultType
	}
	return multipleTypes
}
func GetChangedPaths(previousCommit string) []string {
	r, err := git.PlainOpen(".")
	if err != nil {
		log.Fatal(err)
	}
	head, err := r.Head()
	if err != nil {
		log.Fatal(err)
	}
	currentCommitTree := getTreeFromHash(head.Hash(), r)
	previousCommitTree := getTreeFromStr(previousCommit, r)
	changes, err := currentCommitTree.Diff(previousCommitTree)
	if err != nil {
		log.Fatal(err)
	}
	var changedFiles []string
	for _, change := range changes {
		changedFiles = AddIfNotContained(changedFiles, change.From.Name)
		changedFiles = AddIfNotContained(changedFiles, change.To.Name)
	}
	return changedFiles
}
func IsMainlineOrReleaseRef(currentRef, mainRef, releaseRef string) bool {
	relPattern, _ := regexp.Compile(releaseRef)
	return (currentRef == mainRef) || relPattern.MatchString(currentRef)
}