{"action":"created","comment":{"url":"https://api.github.com/repos/atom/atom/pulls/comments/24838602","id":24838602,"diff_hunk":"@@ -13,6 +13,39 @@ describe \"Project\", ->\n   beforeEach ->\n     atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])\n \n+  describe \"constructor\", ->\n+    it \"tries to update repositories when a new RepositoryProvider is registered\", ->\n+      atom.project.setPaths([\"/tmp\"])\n+      expect(atom.project.getRepositories()).toEqual [null]\n+      expect(atom.project.repositoryProviders.length).toEqual 1\n+\n+      # Register a new RepositoryProvider.\n+      dummyRepository = destroy: () ->\n+      repositoryProvider =\n+        repositoryForDirectory: (directory) -> Promise.resolve(dummyRepository)\n+        repositoryForDirectorySync: (directory) -> dummyRepository\n+      atom.packages.serviceHub.provide(\n+        \"atom.repository-provider\", \"0.1.0\", repositoryProvider)\n+\n+      expect(atom.project.repositoryProviders.length).toBe 2\n+      expect(atom.project.getRepositories()).toEqual [dummyRepository]\n+\n+    it \"does not update @repositories if every path has a Repository\", ->\n+      repositories = atom.project.getRepositories()\n+      expect(repositories.length).toEqual 1\n+      [repository] = repositories\n+      expect(repository).toBeTruthy()\n+\n+      # Register a new RepositoryProvider.\n+      dummyRepository = destroy: () ->","path":"spec/project-spec.coffee","position":null,"original_position":28,"commit_id":"222db8af2156c480d1525dab6edfb234533916f0","original_commit_id":"5805bf967553b2337521b1dc725ebc9b23fdd19e","user":{"login":"bolinfest","id":655869,"avatar_url":"https://avatars.githubusercontent.com/u/655869?v=3","gravatar_id":"","url":"https://api.github.com/users/bolinfest","html_url":"https://github.com/bolinfest","followers_url":"https://api.github.com/users/bolinfest/followers","following_url":"https://api.github.com/users/bolinfest/following{/other_user}","gists_url":"https://api.github.com/users/bolinfest/gists{/gist_id}","starred_url":"https://api.github.com/users/bolinfest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolinfest/subscriptions","organizations_url":"https://api.github.com/users/bolinfest/orgs","repos_url":"https://api.github.com/users/bolinfest/repos","events_url":"https://api.github.com/users/bolinfest/events{/privacy}","received_events_url":"https://api.github.com/users/bolinfest/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-02-17T18:15:31Z","updated_at":"2015-02-17T18:15:31Z","html_url":"https://github.com/atom/atom/pull/5537#discussion_r24838602","pull_request_url":"https://api.github.com/repos/atom/atom/pulls/5537","_links":{"self":{"href":"https://api.github.com/repos/atom/atom/pulls/comments/24838602"},"html":{"href":"https://github.com/atom/atom/pull/5537#discussion_r24838602"},"pull_request":{"href":"https://api.github.com/repos/atom/atom/pulls/5537"}}},"pull_request":{"url":"https://api.github.com/repos/atom/atom/pulls/5537","id":29233037,"html_url":"https://github.com/atom/atom/pull/5537","diff_url":"https://github.com/atom/atom/pull/5537.diff","patch_url":"https://github.com/atom/atom/pull/5537.patch","issue_url":"https://api.github.com/repos/atom/atom/issues/5537","number":5537,"state":"open","locked":false,"title":"Try to set the Project's repo if it does not have one when a new Reposit...","user":{"login":"bolinfest","id":655869,"avatar_url":"https://avatars.githubusercontent.com/u/655869?v=3","gravatar_id":"","url":"https://api.github.com/users/bolinfest","html_url":"https://github.com/bolinfest","followers_url":"https://api.github.com/users/bolinfest/followers","following_url":"https://api.github.com/users/bolinfest/following{/other_user}","gists_url":"https://api.github.com/users/bolinfest/gists{/gist_id}","starred_url":"https://api.github.com/users/bolinfest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolinfest/subscriptions","organizations_url":"https://api.github.com/users/bolinfest/orgs","repos_url":"https://api.github.com/users/bolinfest/repos","events_url":"https://api.github.com/users/bolinfest/events{/privacy}","received_events_url":"https://api.github.com/users/bolinfest/received_events","type":"User","site_admin":false},"body":"...oryProvider is registered.\r\n\r\nI tested this using my test `HgRepositoryProvider`. Now when I run the following from the\r\ncommand line:\r\n\r\n    atom <path-to-directory-with-hg-repository>\r\n\r\nAnd then run the following in the console:\r\n\r\n    atom.project.getRepositories()\r\n\r\nI get an array with an `HgRepository` in it. Previously, I got an empty array because the\r\n`Project`'s paths were set before my `HgRepositoryProvider` was registered.","created_at":"2015-02-13T01:22:38Z","updated_at":"2015-02-17T18:15:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c773c4c443fed728ed78519403f19b1f0614c77a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atom/atom/pulls/5537/commits","review_comments_url":"https://api.github.com/repos/atom/atom/pulls/5537/comments","review_comment_url":"https://api.github.com/repos/atom/atom/pulls/comments/{number}","comments_url":"https://api.github.com/repos/atom/atom/issues/5537/comments","statuses_url":"https://api.github.com/repos/atom/atom/statuses/222db8af2156c480d1525dab6edfb234533916f0","head":{"label":"atom:try-assign-repo-after-provider-is-registered","ref":"try-assign-repo-after-provider-is-registered","sha":"222db8af2156c480d1525dab6edfb234533916f0","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":3228505,"name":"atom","full_name":"atom/atom","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/atom","description":"The hackable editor","fork":false,"url":"https://api.github.com/repos/atom/atom","forks_url":"https://api.github.com/repos/atom/atom/forks","keys_url":"https://api.github.com/repos/atom/atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/atom/teams","hooks_url":"https://api.github.com/repos/atom/atom/hooks","issue_events_url":"https://api.github.com/repos/atom/atom/issues/events{/number}","events_url":"https://api.github.com/repos/atom/atom/events","assignees_url":"https://api.github.com/repos/atom/atom/assignees{/user}","branches_url":"https://api.github.com/repos/atom/atom/branches{/branch}","tags_url":"https://api.github.com/repos/atom/atom/tags","blobs_url":"https://api.github.com/repos/atom/atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/atom/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/atom/languages","stargazers_url":"https://api.github.com/repos/atom/atom/stargazers","contributors_url":"https://api.github.com/repos/atom/atom/contributors","subscribers_url":"https://api.github.com/repos/atom/atom/subscribers","subscription_url":"https://api.github.com/repos/atom/atom/subscription","commits_url":"https://api.github.com/repos/atom/atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/atom/issues/comments/{number}","contents_url":"https://api.github.com/repos/atom/atom/contents/{+path}","compare_url":"https://api.github.com/repos/atom/atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/atom/merges","archive_url":"https://api.github.com/repos/atom/atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/atom/downloads","issues_url":"https://api.github.com/repos/atom/atom/issues{/number}","pulls_url":"https://api.github.com/repos/atom/atom/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/atom/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/atom/labels{/name}","releases_url":"https://api.github.com/repos/atom/atom/releases{/id}","created_at":"2012-01-20T18:18:21Z","updated_at":"2015-02-17T18:07:39Z","pushed_at":"2015-02-17T18:15:22Z","git_url":"git://github.com/atom/atom.git","ssh_url":"git@github.com:atom/atom.git","clone_url":"https://github.com/atom/atom.git","svn_url":"https://github.com/atom/atom","homepage":"https://atom.io/","size":341043,"stargazers_count":12567,"watchers_count":12567,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2111,"mirror_url":null,"open_issues_count":858,"forks":2111,"open_issues":858,"watchers":12567,"default_branch":"master"}},"base":{"label":"atom:master","ref":"master","sha":"55a70da3cf68be175a9df41f5dbc7d4a34b7a67e","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":3228505,"name":"atom","full_name":"atom/atom","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/atom","description":"The hackable editor","fork":false,"url":"https://api.github.com/repos/atom/atom","forks_url":"https://api.github.com/repos/atom/atom/forks","keys_url":"https://api.github.com/repos/atom/atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/atom/teams","hooks_url":"https://api.github.com/repos/atom/atom/hooks","issue_events_url":"https://api.github.com/repos/atom/atom/issues/events{/number}","events_url":"https://api.github.com/repos/atom/atom/events","assignees_url":"https://api.github.com/repos/atom/atom/assignees{/user}","branches_url":"https://api.github.com/repos/atom/atom/branches{/branch}","tags_url":"https://api.github.com/repos/atom/atom/tags","blobs_url":"https://api.github.com/repos/atom/atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/atom/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/atom/languages","stargazers_url":"https://api.github.com/repos/atom/atom/stargazers","contributors_url":"https://api.github.com/repos/atom/atom/contributors","subscribers_url":"https://api.github.com/repos/atom/atom/subscribers","subscription_url":"https://api.github.com/repos/atom/atom/subscription","commits_url":"https://api.github.com/repos/atom/atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/atom/issues/comments/{number}","contents_url":"https://api.github.com/repos/atom/atom/contents/{+path}","compare_url":"https://api.github.com/repos/atom/atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/atom/merges","archive_url":"https://api.github.com/repos/atom/atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/atom/downloads","issues_url":"https://api.github.com/repos/atom/atom/issues{/number}","pulls_url":"https://api.github.com/repos/atom/atom/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/atom/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/atom/labels{/name}","releases_url":"https://api.github.com/repos/atom/atom/releases{/id}","created_at":"2012-01-20T18:18:21Z","updated_at":"2015-02-17T18:07:39Z","pushed_at":"2015-02-17T18:15:22Z","git_url":"git://github.com/atom/atom.git","ssh_url":"git@github.com:atom/atom.git","clone_url":"https://github.com/atom/atom.git","svn_url":"https://github.com/atom/atom","homepage":"https://atom.io/","size":341043,"stargazers_count":12567,"watchers_count":12567,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2111,"mirror_url":null,"open_issues_count":858,"forks":2111,"open_issues":858,"watchers":12567,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/atom/pulls/5537"},"html":{"href":"https://github.com/atom/atom/pull/5537"},"issue":{"href":"https://api.github.com/repos/atom/atom/issues/5537"},"comments":{"href":"https://api.github.com/repos/atom/atom/issues/5537/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/atom/pulls/5537/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/atom/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/atom/atom/pulls/5537/commits"},"statuses":{"href":"https://api.github.com/repos/atom/atom/statuses/222db8af2156c480d1525dab6edfb234533916f0"}}}}