github.com/pluralsh/plural-cli@v0.9.5/pkg/utils/git/utils.go (about)

     1  package git
     2  
     3  import (
     4  	"regexp"
     5  	"strings"
     6  )
     7  
     8  func RepoName(url string) string {
     9  	reg := regexp.MustCompile(".*/")
    10  	base := reg.ReplaceAllString(url, "")
    11  	return strings.TrimSuffix(base, ".git")
    12  }
    13  
    14  func IsSha(str string) bool {
    15  	matches, _ := regexp.MatchString("[a-f0-9]{40}", str)
    16  	return matches
    17  }