     if match, do: acc
   end
 
-  defp with_matching_only(%{opts: other_opts} = other, %{opts: opts} = dep) do
+  # in_upper requires conflict resolution
+  defp with_matching_only(%{opts: other_opts} = other, %{opts: opts} = dep, true) do
     case Keyword.fetch(other_opts, :only) do
       {:ok, other_only} ->
         case Keyword.fetch(opts, :only) do

      # 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}

    # left out as accumulator and upper breadth to help catch
    # inconsistencies across environment, specially regarding
    # the :only option. They are filtered again later.
    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, only, [], current, callback, acc, lock, fn dep ->
        if (converger = Mix.RemoteConverger.get) &&
           converger.remote?(dep) do
          {:loaded, dep}
