The courts may not matter.
You may want to take a look at Article 2, Section 1 of the Constitution and the Election of 1876.
Republicans control this process—regardless of what the courts do.
Please elucidate.