mirror of
https://github.com/atom/atom.git
synced 2026-02-02 18:55:17 -05:00
Don't make the async repo duplicate the work if it's wrapped by a sync repo.
This commit is contained in:
@@ -41,9 +41,9 @@ export default class GitRepositoryAsync {
|
||||
this.subscriptions.add(new Disposable(() => window.removeEventListener('focus', onWindowFocus)))
|
||||
}
|
||||
|
||||
const {project} = options
|
||||
const {project, subscribeToBuffers} = options
|
||||
this.project = project
|
||||
if (this.project) {
|
||||
if (this.project && subscribeToBuffers) {
|
||||
this.project.getBuffers().forEach(buffer => this.subscribeToBuffer(buffer))
|
||||
this.subscriptions.add(this.project.onDidAddBuffer(buffer => this.subscribeToBuffer(buffer)))
|
||||
}
|
||||
|
||||
@@ -76,7 +76,14 @@ class GitRepository
|
||||
unless @repo?
|
||||
throw new Error("No Git repository found searching path: #{path}")
|
||||
|
||||
@async = GitRepositoryAsync.open(path, options)
|
||||
asyncOptions = {}
|
||||
for key, val of options
|
||||
asyncOptions[key] = val
|
||||
# GitRepository itself will handle these cases by manually calling through
|
||||
# to the async repo.
|
||||
asyncOptions.refreshOnWindowFocus = false
|
||||
asyncOptions.subscribeToBuffers = false
|
||||
@async = GitRepositoryAsync.open(path, asyncOptions)
|
||||
|
||||
@statuses = {}
|
||||
@upstream = {ahead: 0, behind: 0}
|
||||
|
||||
Reference in New Issue
Block a user