Cache handlerPath

This commit is contained in:
Kevin Sawicki 2014-05-01 17:05:47 -07:00
parent 7ffc5cc02b
commit 8ec7d1273c

View File

@ -345,10 +345,10 @@ class Git
# Refreshes the current git status in an outside process and asynchronously
# updates the relevant properties.
refreshStatus: ->
handlerPath = require.resolve('./repository-status-handler')
@handlerPath ?= require.resolve('./repository-status-handler')
@statusTask?.terminate()
@statusTask = Task.once handlerPath, @getPath(), ({statuses, upstream, branch, submodules}) =>
@statusTask = Task.once @handlerPath, @getPath(), ({statuses, upstream, branch, submodules}) =>
statusesUnchanged = _.isEqual(statuses, @statuses) and
_.isEqual(upstream, @upstream) and
_.isEqual(branch, @branch) and