func GitClone(remoteURL string) (string, error) {
	if !urlutil.IsGitTransport(remoteURL) {
		remoteURL = "https://" + remoteURL
	}
	root, err := ioutil.TempDir("", "docker-build-git")
	if err != nil {
		return "", err
	}

	u, err := url.Parse(remoteURL)
	if err != nil {
		return "", err
	}

	fragment := u.Fragment
	clone := cloneArgs(u, root)

	if output, err := git(clone...); err != nil {
		return "", fmt.Errorf("Error trying to use git: %s (%s)", err, output)
	}

	return checkoutGit(fragment, root)
}
// GitClone clones a repository into a newly created directory which
// will be under "docker-build-git"
GitClone clones a repository into a newly created directory which
will be under "docker-build-git"
// GitClone clones a repository into a newly created directory which // will be under " docker - build - git "
func GitClone(remoteURL string) (string, error) {
	if !urlutil.IsGitTransport(remoteURL) {
		remoteURL = "https://" + remoteURL
	}
	root, err := ioutil.TempDir("", "docker-build-git")
	if err != nil {
		return "", err
	}
	u, err := url.Parse(remoteURL)
	if err != nil {
		return "", err
	}
	fragment := u.Fragment
	clone := cloneArgs(u, root)
	if output, err := git(clone...); err != nil {
		return "", fmt.Errorf("Error trying to use git: %s (%s)", err, output)
	}
	return checkoutGit(fragment, root)
}
func GitClone ( remoteURL string ) ( string , error ) { if ! urlutil . IsGitTransport ( remoteURL ) { remoteURL = " " + remoteURL } root , err := ioutil . TempDir ( " " , " " ) if err != nil { return " " , err } u , err := url . Parse ( remoteURL ) if err != nil { return " " , err } fragment := u . Fragment clone := cloneArgs ( u , root ) if output , err := git ( clone ... ) ; err != nil { return " " , fmt . Errorf ( " " , err , output ) } return checkoutGit ( fragment , root ) }
GitClone clones a repository into a newly created directory which
will be under "docker-build-git"
GitClone clones a repository into a newly created directory which will be under " docker - build - git "