func getContextFromGitURL()

in builder/parse.go [65:81]


func getContextFromGitURL(gitURL string) string {
	lower := strings.ToLower(gitURL)
	if httpPrefix.MatchString(gitURL) &&
		(strings.Contains(lower, vstsHost) ||
			gitURLWithSuffix.MatchString(gitURL) ||
			strings.Contains(lower, azureDevOpsHost)) {
		pos := strings.LastIndex(gitURL, "#")
		if pos >= 0 {
			frag := gitURL[pos+1:]
			splits := strings.Split(frag, ":")
			if len(splits) >= 2 {
				return splits[1]
			}
		}
	}
	return "."
}