diff --git a/api/client/build.go b/api/client/build.go index 0b9472a0a1..8b1b4fc57f 100644 --- a/api/client/build.go +++ b/api/client/build.go @@ -20,6 +20,7 @@ import ( "github.com/docker/docker/opts" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/fileutils" + "github.com/docker/docker/pkg/gitutils" "github.com/docker/docker/pkg/httputils" "github.com/docker/docker/pkg/jsonmessage" flag "github.com/docker/docker/pkg/mflag" @@ -421,7 +422,7 @@ func getContextFromReader(r io.Reader, dockerfileName string) (absContextDir, re // path of the dockerfile in that context directory, and a non-nil error on // success. func getContextFromGitURL(gitURL, dockerfileName string) (absContextDir, relDockerfile string, err error) { - if absContextDir, err = utils.GitClone(gitURL); err != nil { + if absContextDir, err = gitutils.Clone(gitURL); err != nil { return "", "", fmt.Errorf("unable to 'git clone' to temporary context directory: %v", err) } diff --git a/builder/git.go b/builder/git.go index e857060cc0..74df244611 100644 --- a/builder/git.go +++ b/builder/git.go @@ -4,12 +4,12 @@ import ( "os" "github.com/docker/docker/pkg/archive" - "github.com/docker/docker/utils" + "github.com/docker/docker/pkg/gitutils" ) // MakeGitContext returns a Context from gitURL that is cloned in a temporary directory. func MakeGitContext(gitURL string) (ModifiableContext, error) { - root, err := utils.GitClone(gitURL) + root, err := gitutils.Clone(gitURL) if err != nil { return nil, err } diff --git a/utils/git.go b/pkg/gitutils/gitutils.go similarity index 94% rename from utils/git.go rename to pkg/gitutils/gitutils.go index 4d0bb16417..ded091f2a2 100644 --- a/utils/git.go +++ b/pkg/gitutils/gitutils.go @@ -1,4 +1,4 @@ -package utils +package gitutils import ( "fmt" @@ -14,9 +14,9 @@ import ( "github.com/docker/docker/pkg/urlutil" ) -// GitClone clones a repository into a newly created directory which +// Clone clones a repository into a newly created directory which // will be under "docker-build-git" -func GitClone(remoteURL string) (string, error) { +func Clone(remoteURL string) (string, error) { if !urlutil.IsGitTransport(remoteURL) { remoteURL = "https://" + remoteURL } diff --git a/utils/git_test.go b/pkg/gitutils/gitutils_test.go similarity index 99% rename from utils/git_test.go rename to pkg/gitutils/gitutils_test.go index e9eb595630..4ef37ff736 100644 --- a/utils/git_test.go +++ b/pkg/gitutils/gitutils_test.go @@ -1,4 +1,4 @@ -package utils +package gitutils import ( "fmt"