From 94449f772c1c01ea71cc7c6e0c71873fccee99a0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 27 Feb 2013 17:48:13 -0800 Subject: [PATCH] Initialize statuses and task variables correctly --- src/app/git.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/git.coffee b/src/app/git.coffee index 8e24a4b97..f73517a33 100644 --- a/src/app/git.coffee +++ b/src/app/git.coffee @@ -8,6 +8,7 @@ RepositoryStatusTask = require 'repository-status-task' module.exports = class Git @open: (path, options) -> + return null unless path try new Git(path, options) catch e @@ -25,9 +26,10 @@ class Git working_dir_typechange: 1 << 10 ignore: 1 << 14 - statuses: {} + statuses: null constructor: (path, options={}) -> + @statuses = {} @repo = GitRepository.open(path) refreshOnWindowFocus = options.refreshOnWindowFocus ? true if refreshOnWindowFocus @@ -114,7 +116,8 @@ class Git @getRepo().isSubmodule(@relativize(path)) refreshStatus: -> - @statusTask = new RepositoryStatusTask(this).start() + @statusTask = new RepositoryStatusTask(this) + @statusTask.start() _.extend Git.prototype, Subscriber _.extend Git.prototype, EventEmitter