{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/89823675","pull_request_review_id":10357192,"id":89823675,"diff_hunk":"@@ -19,86 +22,94 @@ type Clone struct {\n func (c *Clone) Download(config *api.Config) (*api.SourceInfo, error) {\n \ttargetSourceDir := filepath.Join(config.WorkingDir, api.Source)\n \tconfig.WorkingSourceDir = targetSourceDir\n-\tvar info *api.SourceInfo\n-\thasRef := len(config.Ref) > 0\n-\tcloneConfig := api.CloneConfig{Quiet: true, Recursive: !config.IgnoreSubmodules && !hasRef}\n \n \tok, err := c.ValidCloneSpec(config.Source)\n \tif err != nil {\n \t\treturn nil, err\n \t}\n+\tif !ok {\n+\t\tglog.Errorf(\"Clone.Download was passed an invalid source %s\", config.Source)\n+\t\treturn nil, fmt.Errorf(\"invalid source %s\", config.Source)\n+\t}\n \n-\tif ok {\n-\t\tif len(config.ContextDir) > 0 {\n-\t\t\ttargetSourceDir = filepath.Join(config.WorkingDir, api.ContextTmp)\n-\t\t\tglog.V(1).Infof(\"Downloading %q (%q) ...\", config.Source, config.ContextDir)\n-\t\t} else {\n-\t\t\tglog.V(1).Infof(\"Downloading %q ...\", config.Source)\n-\t\t}\n+\tref := \"HEAD\"\n+\tif config.Ref != \"\" {\n+\t\tref = config.Ref\n+\t}\n \n-\t\t// If we have a specific checkout ref, use submodule update instead of recursive\n-\t\t// Otherwise the versions will be incorrect.\n-\t\tif hasRef && !config.IgnoreSubmodules {\n-\t\t\tglog.V(2).Infof(\"Cloning sources (deferring submodule init) into %q\", targetSourceDir)\n-\t\t} else if !hasRef && !config.IgnoreSubmodules {\n-\t\t\tglog.V(2).Infof(\"Cloning sources and all Git submodules (recursive) into %q\", targetSourceDir)\n-\t\t} else {\n-\t\t\tglog.V(2).Infof(\"Cloning sources (ignoring submodules) into %q\", targetSourceDir)\n-\t\t}\n+\tif strings.HasPrefix(config.Source, \"file://\") {\n+\t\ts := strings.TrimPrefix(config.Source, \"file://\")\n \n-\t\tif err := c.Clone(config.Source, targetSourceDir, cloneConfig); err != nil {\n-\t\t\tglog.V(1).Infof(\"Git clone failed: %+v\", err)\n-\t\t\treturn nil, err\n-\t\t}\n-\n-\t\tif hasRef {\n-\t\t\tif err := c.Checkout(targetSourceDir, config.Ref); err != nil {\n-\t\t\t\treturn nil, err\n-\t\t\t}\n-\t\t\tglog.V(1).Infof(\"Checked out %q\", config.Ref)\n-\t\t\tif !config.IgnoreSubmodules {\n-\t\t\t\tif err := c.SubmoduleUpdate(targetSourceDir, true, true); err != nil {\n-\t\t\t\t\treturn nil, err\n-\t\t\t\t}\n-\t\t\t\tglog.V(1).Infof(\"Updated submodules for %q\", config.Ref)\n-\t\t\t}\n-\t\t}\n-\n-\t\tif len(config.ContextDir) > 0 {\n-\t\t\toriginalTargetDir := filepath.Join(config.WorkingDir, api.Source)\n-\t\t\tc.RemoveDirectory(originalTargetDir)\n-\t\t\t// we want to copy entire dir contents, thus we need to use dir/. construct\n-\t\t\tpath := filepath.Join(targetSourceDir, config.ContextDir) + string(filepath.Separator) + \".\"\n-\t\t\terr := c.Copy(path, originalTargetDir)\n+\t\tif util.UsingCygwinGit {\n+\t\t\tvar err error\n+\t\t\ts, err = util.ToSlashCygwin(s)\n \t\t\tif err != nil {\n+\t\t\t\tglog.V(1).Infof(\"ToSlashCygwin failed: %+v\", err)","path":"pkg/scm/git/clone.go","position":84,"original_position":84,"commit_id":"da0520bacf5dcce2f0005b1e728e99f21691343f","original_commit_id":"81d2b196a299fcfbb92dbdefef54514d71829854","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"body":"> 4. If an operand implements the error interface, the Error method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any).\r\n\r\n(https://golang.org/pkg/fmt/)\r\n\r\nSo actually `%v` and `%+v` seem to do the same for errors: https://play.golang.org/p/OlpINauKU-","created_at":"2016-11-28T16:46:07Z","updated_at":"2016-11-28T16:46:07Z","html_url":"https://github.com/openshift/source-to-image/pull/625#discussion_r89823675","pull_request_url":"https://api.github.com/repos/openshift/source-to-image/pulls/625","_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/89823675"},"html":{"href":"https://github.com/openshift/source-to-image/pull/625#discussion_r89823675"},"pull_request":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/625"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/625","id":91381473,"html_url":"https://github.com/openshift/source-to-image/pull/625","diff_url":"https://github.com/openshift/source-to-image/pull/625.diff","patch_url":"https://github.com/openshift/source-to-image/pull/625.patch","issue_url":"https://api.github.com/repos/openshift/source-to-image/issues/625","number":625,"state":"open","locked":false,"title":"s2i windows support","user":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"body":"With this PR, unit and integration tests pass on Windows.\n","created_at":"2016-10-28T13:28:23Z","updated_at":"2016-11-28T16:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60cc2fd942f7a7b4223915b391d004199797a661","assignee":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"assignees":[{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/source-to-image/pulls/625/commits","review_comments_url":"https://api.github.com/repos/openshift/source-to-image/pulls/625/comments","review_comment_url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/source-to-image/issues/625/comments","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/da0520bacf5dcce2f0005b1e728e99f21691343f","head":{"label":"jim-minter:windows","ref":"windows","sha":"da0520bacf5dcce2f0005b1e728e99f21691343f","user":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"repo":{"id":69250540,"name":"source-to-image","full_name":"jim-minter/source-to-image","owner":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jim-minter/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":true,"url":"https://api.github.com/repos/jim-minter/source-to-image","forks_url":"https://api.github.com/repos/jim-minter/source-to-image/forks","keys_url":"https://api.github.com/repos/jim-minter/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jim-minter/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jim-minter/source-to-image/teams","hooks_url":"https://api.github.com/repos/jim-minter/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/jim-minter/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/jim-minter/source-to-image/events","assignees_url":"https://api.github.com/repos/jim-minter/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/jim-minter/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/jim-minter/source-to-image/tags","blobs_url":"https://api.github.com/repos/jim-minter/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jim-minter/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jim-minter/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/jim-minter/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jim-minter/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/jim-minter/source-to-image/languages","stargazers_url":"https://api.github.com/repos/jim-minter/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/jim-minter/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/jim-minter/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/jim-minter/source-to-image/subscription","commits_url":"https://api.github.com/repos/jim-minter/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/jim-minter/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/jim-minter/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/jim-minter/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/jim-minter/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/jim-minter/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jim-minter/source-to-image/merges","archive_url":"https://api.github.com/repos/jim-minter/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jim-minter/source-to-image/downloads","issues_url":"https://api.github.com/repos/jim-minter/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/jim-minter/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/jim-minter/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/jim-minter/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jim-minter/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/jim-minter/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/jim-minter/source-to-image/deployments","created_at":"2016-09-26T13:02:53Z","updated_at":"2016-09-26T13:02:54Z","pushed_at":"2016-11-28T16:38:49Z","git_url":"git://github.com/jim-minter/source-to-image.git","ssh_url":"git@github.com:jim-minter/source-to-image.git","clone_url":"https://github.com/jim-minter/source-to-image.git","svn_url":"https://github.com/jim-minter/source-to-image","homepage":"","size":15634,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"12908b75a9d965425ef35a84d729f750f38eeb72","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":16323162,"name":"source-to-image","full_name":"openshift/source-to-image","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":false,"url":"https://api.github.com/repos/openshift/source-to-image","forks_url":"https://api.github.com/repos/openshift/source-to-image/forks","keys_url":"https://api.github.com/repos/openshift/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/source-to-image/teams","hooks_url":"https://api.github.com/repos/openshift/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/openshift/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/source-to-image/events","assignees_url":"https://api.github.com/repos/openshift/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/source-to-image/tags","blobs_url":"https://api.github.com/repos/openshift/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/source-to-image/languages","stargazers_url":"https://api.github.com/repos/openshift/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/openshift/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/openshift/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/openshift/source-to-image/subscription","commits_url":"https://api.github.com/repos/openshift/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/source-to-image/merges","archive_url":"https://api.github.com/repos/openshift/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/source-to-image/downloads","issues_url":"https://api.github.com/repos/openshift/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/openshift/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/source-to-image/deployments","created_at":"2014-01-28T19:32:40Z","updated_at":"2016-11-23T02:01:29Z","pushed_at":"2016-11-28T16:38:50Z","git_url":"git://github.com/openshift/source-to-image.git","ssh_url":"git@github.com:openshift/source-to-image.git","clone_url":"https://github.com/openshift/source-to-image.git","svn_url":"https://github.com/openshift/source-to-image","homepage":"","size":15761,"stargazers_count":332,"watchers_count":332,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":158,"mirror_url":null,"open_issues_count":24,"forks":158,"open_issues":24,"watchers":332,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/625"},"html":{"href":"https://github.com/openshift/source-to-image/pull/625"},"issue":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/625"},"comments":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/625/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/625/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/625/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/source-to-image/statuses/da0520bacf5dcce2f0005b1e728e99f21691343f"}}}}
{"actor":{"display_login":"rhcarvalho"}}