From 8ec7d1273c7e49e147da171d356180c18a8216ff Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 1 May 2014 17:05:47 -0700 Subject: [PATCH] Cache handlerPath --- src/git.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git.coffee b/src/git.coffee index b1dd6caa7..976634eb7 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -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