func IsTruncatedCommitSHA(sha string) bool {
	return truncatedCommitSHARegex.MatchString(sha)
}
IsTruncatedCommitSHA returns whether or not a string is a truncated  SHA-1
package git
import (
	"net/url"
	"regexp"
	"strings"
)
func ensurePrefix(s, prefix string) string {
	if !strings.HasPrefix(s, prefix) {
		s = prefix + s
	}
	return s
}
func removeSuffix(s, suffix string) string {
	if strings.HasSuffix(s, suffix) {
		return s[0 : len(s)-len(suffix)]
	}
	return s
}
var (
	commitSHARegex = regexp.MustCompile("^[0-9A-Fa-f]{40}$")
	sshURLRegex    = regexp.MustCompile("^(ssh://)?([^/:]*?)@[^@]+$")
	httpsURLRegex  = regexp.MustCompile("^(https://).*")
	httpURLRegex   = regexp.MustCompile("^(http://).*")
)
func IsCommitSHA(sha string) bool {
	return commitSHARegex.MatchString(sha)
}
var truncatedCommitSHARegex = regexp.MustCompile("^[0-9A-Fa-f]{7,}$")