Make sure remote is always called "origin" when cloning git repo #2996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on #2995 I ran into a problem that prevented me from running scala steward locally on my machine.
That's because in my
~/.gitconfig
I configured that the default remote of a freshly cloned git repo should always be calledupstream
:However, if you grep through the scala-steward source code, you will see that scala-stewared heavily and basically everywhere and always relies on the remote's name to be
origin
.So this pull requests make sure that when scala-steward clones a git repository the name of the remote is always called "origin" by overriding global git config (user) setting directly at the git-clone command.
With this fix I was able to run scala-steward locally, without it it always failed (or better: the git commands scala-steward calls failed in their sub-processes).
BTW, I had the same issue already with pacman (package manager for arch linux), where I applied the same fix:
-c clone.defaultRemoteName=origin
in that merge request)I am 100% sure this fix is correct (since I tested it locally 😉). Thanks!