{"action":"created","comment":{"url":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/23074273","id":23074273,"diff_hunk":"@@ -105,17 +105,19 @@ def import_remote(type, user, source, name, params={})\n   protected\n \n   def detect_source_type\n-    if GitRepository.is_git_repository?(source_address)\n-      self.source_type = 'git'\n-    elsif GitRepository.is_svn_repository?(source_address)\n-      self.source_type = 'svn'\n+    if source_address?\n+      if GitRepository.is_git_repository?(source_address)\n+        self.source_type = 'git'\n+      elsif GitRepository.is_svn_repository?(source_address)\n+        self.source_type = 'svn'\n+      end\n     end\n   end\n \n   class SourceTypeValidator < ActiveModel::Validator\n     def validate(record)\n       if record.mirror? && !record.source_type.present?\n-        record.errors[:source_address] = \"not a valid remote repository (types supported: #{SOURCE_TYPES.join(', ')})\"\n+        record.errors[:source_address] = \"not a valid remote repository or not accessible (types supported: #{SOURCE_TYPES.join(', ')})\"","path":"app/models/repository/importing.rb","position":21,"original_position":21,"commit_id":"6db3ea7ca8f9de8e3e2275e17700d72563784ad4","original_commit_id":"6db3ea7ca8f9de8e3e2275e17700d72563784ad4","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Metrics/LineLength: Line is too long. [136/80]","created_at":"2015-01-16T10:58:17Z","updated_at":"2015-01-16T10:58:17Z","html_url":"https://github.com/ontohub/ontohub/pull/1161#discussion_r23074273","pull_request_url":"https://api.github.com/repos/ontohub/ontohub/pulls/1161","_links":{"self":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/23074273"},"html":{"href":"https://github.com/ontohub/ontohub/pull/1161#discussion_r23074273"},"pull_request":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1161"}}},"pull_request":{"url":"https://api.github.com/repos/ontohub/ontohub/pulls/1161","id":27497865,"html_url":"https://github.com/ontohub/ontohub/pull/1161","diff_url":"https://github.com/ontohub/ontohub/pull/1161.diff","patch_url":"https://github.com/ontohub/ontohub/pull/1161.patch","issue_url":"https://api.github.com/repos/ontohub/ontohub/issues/1161","number":1161,"state":"open","locked":false,"title":"1159 create mirror of private GitHub repository","user":{"login":"eugenk","id":339751,"avatar_url":"https://avatars.githubusercontent.com/u/339751?v=3","gravatar_id":"","url":"https://api.github.com/users/eugenk","html_url":"https://github.com/eugenk","followers_url":"https://api.github.com/users/eugenk/followers","following_url":"https://api.github.com/users/eugenk/following{/other_user}","gists_url":"https://api.github.com/users/eugenk/gists{/gist_id}","starred_url":"https://api.github.com/users/eugenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugenk/subscriptions","organizations_url":"https://api.github.com/users/eugenk/orgs","repos_url":"https://api.github.com/users/eugenk/repos","events_url":"https://api.github.com/users/eugenk/events{/privacy}","received_events_url":"https://api.github.com/users/eugenk/received_events","type":"User","site_admin":false},"body":"This is more of a workaround than a fix for #1159.\r\n\r\nI don't see any fast way to check if something is a git repository than `git ls-remote`. However, this asks for credentials when calling it on a github private repository.\r\n\r\nI tried to read the login prompt of `git ls-remote` in `Subprocess.run`, but I could not get my hands on the prompt lines. Neither with `IO.popen` nor with `Open3.popen2e`.\r\n\r\nThe best solution would be to read those login prompt lines and abort if they are present, but I can't figure out how to do this, because they are not printed to stdout nor stderr of the child process.","created_at":"2015-01-16T10:58:10Z","updated_at":"2015-01-16T10:58:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5631db4a199892e1fe5a0ca93f9aee3dedddd067","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ontohub/ontohub/pulls/1161/commits","review_comments_url":"https://api.github.com/repos/ontohub/ontohub/pulls/1161/comments","review_comment_url":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ontohub/ontohub/issues/1161/comments","statuses_url":"https://api.github.com/repos/ontohub/ontohub/statuses/6db3ea7ca8f9de8e3e2275e17700d72563784ad4","head":{"label":"ontohub:1159-create_mirror_of_private_github_repository","ref":"1159-create_mirror_of_private_github_repository","sha":"6db3ea7ca8f9de8e3e2275e17700d72563784ad4","user":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=3","gravatar_id":"","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"repo":{"id":3643206,"name":"ontohub","full_name":"ontohub/ontohub","owner":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=3","gravatar_id":"","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ontohub/ontohub","description":"A web-based repository for distributed ontologies.","fork":false,"url":"https://api.github.com/repos/ontohub/ontohub","forks_url":"https://api.github.com/repos/ontohub/ontohub/forks","keys_url":"https://api.github.com/repos/ontohub/ontohub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ontohub/ontohub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ontohub/ontohub/teams","hooks_url":"https://api.github.com/repos/ontohub/ontohub/hooks","issue_events_url":"https://api.github.com/repos/ontohub/ontohub/issues/events{/number}","events_url":"https://api.github.com/repos/ontohub/ontohub/events","assignees_url":"https://api.github.com/repos/ontohub/ontohub/assignees{/user}","branches_url":"https://api.github.com/repos/ontohub/ontohub/branches{/branch}","tags_url":"https://api.github.com/repos/ontohub/ontohub/tags","blobs_url":"https://api.github.com/repos/ontohub/ontohub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ontohub/ontohub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ontohub/ontohub/git/refs{/sha}","trees_url":"https://api.github.com/repos/ontohub/ontohub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ontohub/ontohub/statuses/{sha}","languages_url":"https://api.github.com/repos/ontohub/ontohub/languages","stargazers_url":"https://api.github.com/repos/ontohub/ontohub/stargazers","contributors_url":"https://api.github.com/repos/ontohub/ontohub/contributors","subscribers_url":"https://api.github.com/repos/ontohub/ontohub/subscribers","subscription_url":"https://api.github.com/repos/ontohub/ontohub/subscription","commits_url":"https://api.github.com/repos/ontohub/ontohub/commits{/sha}","git_commits_url":"https://api.github.com/repos/ontohub/ontohub/git/commits{/sha}","comments_url":"https://api.github.com/repos/ontohub/ontohub/comments{/number}","issue_comment_url":"https://api.github.com/repos/ontohub/ontohub/issues/comments/{number}","contents_url":"https://api.github.com/repos/ontohub/ontohub/contents/{+path}","compare_url":"https://api.github.com/repos/ontohub/ontohub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ontohub/ontohub/merges","archive_url":"https://api.github.com/repos/ontohub/ontohub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ontohub/ontohub/downloads","issues_url":"https://api.github.com/repos/ontohub/ontohub/issues{/number}","pulls_url":"https://api.github.com/repos/ontohub/ontohub/pulls{/number}","milestones_url":"https://api.github.com/repos/ontohub/ontohub/milestones{/number}","notifications_url":"https://api.github.com/repos/ontohub/ontohub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ontohub/ontohub/labels{/name}","releases_url":"https://api.github.com/repos/ontohub/ontohub/releases{/id}","created_at":"2012-03-06T22:05:27Z","updated_at":"2015-01-07T15:13:29Z","pushed_at":"2015-01-16T10:52:12Z","git_url":"git://github.com/ontohub/ontohub.git","ssh_url":"git@github.com:ontohub/ontohub.git","clone_url":"https://github.com/ontohub/ontohub.git","svn_url":"https://github.com/ontohub/ontohub","homepage":"","size":28437,"stargazers_count":18,"watchers_count":18,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":304,"forks":6,"open_issues":304,"watchers":18,"default_branch":"staging"}},"base":{"label":"ontohub:staging","ref":"staging","sha":"c60016ca0f8803c5eccf811c5d7662448bd27e52","user":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=3","gravatar_id":"","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"repo":{"id":3643206,"name":"ontohub","full_name":"ontohub/ontohub","owner":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=3","gravatar_id":"","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ontohub/ontohub","description":"A web-based repository for distributed ontologies.","fork":false,"url":"https://api.github.com/repos/ontohub/ontohub","forks_url":"https://api.github.com/repos/ontohub/ontohub/forks","keys_url":"https://api.github.com/repos/ontohub/ontohub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ontohub/ontohub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ontohub/ontohub/teams","hooks_url":"https://api.github.com/repos/ontohub/ontohub/hooks","issue_events_url":"https://api.github.com/repos/ontohub/ontohub/issues/events{/number}","events_url":"https://api.github.com/repos/ontohub/ontohub/events","assignees_url":"https://api.github.com/repos/ontohub/ontohub/assignees{/user}","branches_url":"https://api.github.com/repos/ontohub/ontohub/branches{/branch}","tags_url":"https://api.github.com/repos/ontohub/ontohub/tags","blobs_url":"https://api.github.com/repos/ontohub/ontohub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ontohub/ontohub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ontohub/ontohub/git/refs{/sha}","trees_url":"https://api.github.com/repos/ontohub/ontohub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ontohub/ontohub/statuses/{sha}","languages_url":"https://api.github.com/repos/ontohub/ontohub/languages","stargazers_url":"https://api.github.com/repos/ontohub/ontohub/stargazers","contributors_url":"https://api.github.com/repos/ontohub/ontohub/contributors","subscribers_url":"https://api.github.com/repos/ontohub/ontohub/subscribers","subscription_url":"https://api.github.com/repos/ontohub/ontohub/subscription","commits_url":"https://api.github.com/repos/ontohub/ontohub/commits{/sha}","git_commits_url":"https://api.github.com/repos/ontohub/ontohub/git/commits{/sha}","comments_url":"https://api.github.com/repos/ontohub/ontohub/comments{/number}","issue_comment_url":"https://api.github.com/repos/ontohub/ontohub/issues/comments/{number}","contents_url":"https://api.github.com/repos/ontohub/ontohub/contents/{+path}","compare_url":"https://api.github.com/repos/ontohub/ontohub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ontohub/ontohub/merges","archive_url":"https://api.github.com/repos/ontohub/ontohub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ontohub/ontohub/downloads","issues_url":"https://api.github.com/repos/ontohub/ontohub/issues{/number}","pulls_url":"https://api.github.com/repos/ontohub/ontohub/pulls{/number}","milestones_url":"https://api.github.com/repos/ontohub/ontohub/milestones{/number}","notifications_url":"https://api.github.com/repos/ontohub/ontohub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ontohub/ontohub/labels{/name}","releases_url":"https://api.github.com/repos/ontohub/ontohub/releases{/id}","created_at":"2012-03-06T22:05:27Z","updated_at":"2015-01-07T15:13:29Z","pushed_at":"2015-01-16T10:52:12Z","git_url":"git://github.com/ontohub/ontohub.git","ssh_url":"git@github.com:ontohub/ontohub.git","clone_url":"https://github.com/ontohub/ontohub.git","svn_url":"https://github.com/ontohub/ontohub","homepage":"","size":28437,"stargazers_count":18,"watchers_count":18,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":304,"forks":6,"open_issues":304,"watchers":18,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1161"},"html":{"href":"https://github.com/ontohub/ontohub/pull/1161"},"issue":{"href":"https://api.github.com/repos/ontohub/ontohub/issues/1161"},"comments":{"href":"https://api.github.com/repos/ontohub/ontohub/issues/1161/comments"},"review_comments":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1161/comments"},"review_comment":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1161/commits"},"statuses":{"href":"https://api.github.com/repos/ontohub/ontohub/statuses/6db3ea7ca8f9de8e3e2275e17700d72563784ad4"}}}}