mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Try to set the Project's repo if it does not have one when a new RepositoryProvider is registered.
I tested this using my test `HgRepositoryProvider`. Now when I run the following from the
command line:
atom <path-to-directory-with-hg-repository>
And then run the following in the console:
atom.project.getRepositories()
I get an array with an `HgRepository` in it. Previously, I got an empty array because the
`Project`'s paths were set before my `HgRepositoryProvider` was registered.
This commit is contained in:
@@ -53,7 +53,15 @@ class Project extends Model
|
||||
atom.packages.serviceHub.consume(
|
||||
'atom.repository-provider',
|
||||
'^0.1.0',
|
||||
(provider) => @repositoryProviders.push(provider))
|
||||
(provider) =>
|
||||
@repositoryProviders.push(provider)
|
||||
|
||||
# If a path in getPaths() does not have a corresponding Repository, try
|
||||
# to assign one by running through setPaths() again now that
|
||||
# @repositoryProviders has been updated.
|
||||
if null in @repositories
|
||||
@setPaths(@getPaths())
|
||||
)
|
||||
|
||||
@subscribeToBuffer(buffer) for buffer in @buffers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user