     # left out as accumulator and upper breadth to help catch
     # inconsistencies across environment, specially regarding
     # the :only option. They are filtered again later.
-    {main, upper} = Mix.Dep.Loader.partition_by_env(deps, opts)
-    apps = Enum.map(main, &(&1.app))
+    current = Enum.map(deps, &(&1.app))
+    {main, only} = Mix.Dep.Loader.partition_by_env(deps, opts)
 
     # Run converger for all dependencies, except remote
     # dependencies. Since the remote converger may be
     # lazily loaded, we need to check for it on every
     # iteration.
     {deps, rest, lock} =
-      all(main, upper, upper, apps, callback, acc, lock, fn dep ->
+      all(main, only, [], current, callback, acc, lock, fn dep ->
         if (converger = Mix.RemoteConverger.get) &&
            converger.remote?(dep) do
           {:loaded, dep}

      # valid.
      lock_for_converger = lock || Mix.Dep.Lock.read

      all(main, [], [], apps, callback, rest, lock, fn dep ->
        cond do
          cached = deps[dep.app] ->
            {:loaded, cached}

          app != other_app ->
            {other, match}
          in_upper? && other_opts[:override] ->
            {other |> with_matching_only(dep, in_upper?), true}
          converge?(other, dep) ->
            {other |> with_matching_only(dep, in_upper?) |> with_matching_req(dep), true}
          true ->
            tag = if in_upper?, do: :overridden, else: :diverged
            {%{other | status: {tag, dep}}, true}
