Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
root: make "upstream" the defaultRemote preference
When a user fork a project from nothing the "forkToUpstream" approach is used, where two remotes are set in the resulting git directory: "origin" and "upstream", with obvious meanings. However, when the user fork a project directly from a git directory, where the "origin" remote is already set, then a new remote with user's username is set for the fork. The current code for defaultRemote has "origin" as the dominant remote, however, this remote has two different meanings depending on how the fork was created: in the first approach, mentioned earlier, "origin" points to the fork, while in the second it points to the actual upstream project. With that, users get quite confused why `lab mr list` sometimes lists the MR against upstream project and other times it lists MRs from the fork. From what I've seen/used and read from the code, defaultRemote should always point to the upstream project whenever possible. This patch does exact it. The change is pretty simple: turn "upstream" remote as the prefereble one, but the result is far more consistent to the user experience. Signed-off-by: Bruno Meneguele <[email protected]>
- Loading branch information