       else
         @commitsBehind.style.display = 'none'
 
-      @commitsArea.style.display = '' if ahead > 0 or behind > 0
+    if ahead > 0 or behind > 0
+      @commitsArea.style.display = ''
+    else
+      @commitsArea.style.display = 'none'
 
-    status = repo.getCachedPathStatus(itemPath) ? 0
+  updateStatusText: ->
+    itemPath = @getActiveItemPath()
+    repo = atom.project.getRepo()
+
+    status = repo?.getCachedPathStatus(itemPath) ? 0
     @gitStatusIcon.classList.remove('icon-diff-modified', 'status-modified', 'icon-diff-added', 'status-added', 'icon-diff-ignored', 'status-ignored')
 
-    if repo.isStatusModified(status)
+    if repo?.isStatusModified(status)
       @gitStatusIcon.classList.add('icon-diff-modified', 'status-modified')
       stats = repo.getDiffStats(itemPath)
       if stats.added and stats.deleted

    else
      not @getActiveItem()?

  updateStatusText: ->
    itemPath = @getActiveItemPath()
    @gitStatus.style.display = 'none'
    @commitsArea.style.display = 'none'

    repo = atom.project.getRepo()
    return unless repo?

    if @showBranchInformation()
      {ahead, behind} = repo.getCachedUpstreamAheadBehindCount(itemPath) ? {}

      if ahead > 0


  update: =>
    @updateBranchText()
    @updateAheadBehindCount()
    @updateStatusText()

  updateBranchText: ->
