func parseWeirdGitURL(repo string) (pathParts []string, err error) {

	hostIndex := strings.Index(repo, "@") + 1
	pathIndex := strings.Index(repo, ":") + 1
	repoPath := strings.Split(string(repo[pathIndex:]), "/")

	// If there is no : then this is wrong
	if pathIndex == 0 || len(repoPath) == 0 {
		err = errors.New("Missing path part")
		return
	}

	// if index of @ is -1 then host is the first thing
	// if @ is after : then it's part of the path
	if hostIndex > pathIndex {
		hostIndex = 0
	}

	host := string(repo[hostIndex : pathIndex-1])
	pathParts = append(pathParts, host)

	for _, pathPart := range repoPath {
		if pathPart == "" {
			err = fmt.Errorf("Blank path segment")
			return
		}
		pathParts = append(pathParts, pathPart)
	}

	return
}
// parseWeirdGitURL tries to make sense of a user@host:path format git URL
parseWeirdGitURL tries to make sense of a user@host:path format git URL
// parseWeirdGitURL tries to make sense of a user@host : path format git URL
func parseWeirdGitURL(repo string) (pathParts []string, err error) {
	hostIndex := strings.Index(repo, "@") + 1
	pathIndex := strings.Index(repo, ":") + 1
	repoPath := strings.Split(string(repo[pathIndex:]), "/")
	if pathIndex == 0 || len(repoPath) == 0 {
		err = errors.New("Missing path part")
		return
	}
	if hostIndex > pathIndex {
		hostIndex = 0
	}
	host := string(repo[hostIndex : pathIndex-1])
	pathParts = append(pathParts, host)
	for _, pathPart := range repoPath {
		if pathPart == "" {
			err = fmt.Errorf("Blank path segment")
			return
		}
		pathParts = append(pathParts, pathPart)
	}
	return
}
func parseWeirdGitURL ( repo string ) ( pathParts [ ] string , err error ) { hostIndex := strings . Index ( repo , " " ) + 1 pathIndex := strings . Index ( repo , " " ) + 1 repoPath := strings . Split ( string ( repo [ pathIndex : ] ) , " " ) if pathIndex == 0 || len ( repoPath ) == 0 { err = errors . New ( " " ) return } if hostIndex > pathIndex { hostIndex = 0 } host := string ( repo [ hostIndex : pathIndex - 1 ] ) pathParts = append ( pathParts , host ) for _ , pathPart := range repoPath { if pathPart == " " { err = fmt . Errorf ( " " ) return } pathParts = append ( pathParts , pathPart ) } return }
parseWeirdGitURL tries to make sense of a user@host:path format git URL
parseWeirdGitURL tries to make sense of a user@host : path format git URL
// If there is no : then this is wrong // if index of @ is -1 then host is the first thing // if @ is after : then it's part of the path