       @pkg.didStageFile file: filePath
 
   @detect: (pkg) ->
-    return unless atom.project.getRepositories().length > 0
     return if @instance?
 
-    MergeState.read (err, state) =>
+    repo = GitBridge.getActiveRepo()
+    unless repo?
+      atom.notifications.addWarning "No git repository found",
+        detail: "Tip: if you have multiple projects open, open an editor in the one"
+          "containing conflicts."
+      return
+
+    MergeState.read repo, (err, state) =>
       return if handleErr(err)
 
       if not state.isEmpty()

    @subs = new CompositeDisposable

    @subs.add @pkg.onDidResolveConflict (event) =>
      p = GitBridge.repoRelativePath event.file
      found = false
      for listElement in @pathList.children()
        li = $(listElement)

    return if state.isEmpty()

    fullPath = editor.getPath()
    repoPath = state.repo.relativize fullPath
    return unless repoPath?

    return unless _.contains state.conflictPaths(), repoPath
