Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically detect a remote that is not called "origin" so that users don't have to enter the remote name manually #160

Merged

Conversation

KetchupOnMyKetchup
Copy link
Contributor

@KetchupOnMyKetchup KetchupOnMyKetchup commented May 1, 2023

Closes #121

If remote cannot find "origin", then automatically try to get the next remote regardless of name so that the user does not have to enter it manually.

The reason this did not work before is that origin was keyed into the getRemoteName() method:
image

And the filter on line 70 was only checking for origin:
image

So if it did not find it, then it just returned undefined and the user had to set the remote manually. I think that it makes sense to search for origin first, but then to automatically grab any other existing remote if possible.

Before fix:
image

After fix:
nonoriginworking

Co-authored by @lrotschy

Crystal Tenn and others added 2 commits May 1, 2023 16:10
…t remote regardless of name so that the user does not have to enter it manually.

Co-authored-by: Liela Rotschy <lrotschy@github.com>
@KetchupOnMyKetchup KetchupOnMyKetchup changed the title Automatically detect a remote that is not called "origin" Automatically detect a remote that is not called "origin" so that users don't have to enter the remote name manually May 1, 2023
@KetchupOnMyKetchup KetchupOnMyKetchup marked this pull request as ready for review May 1, 2023 20:23
@KetchupOnMyKetchup KetchupOnMyKetchup requested a review from a team as a code owner May 1, 2023 20:23
Copy link
Contributor

@jtamsut jtamsut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Very clear.

@KetchupOnMyKetchup KetchupOnMyKetchup merged commit 5340397 into main May 3, 2023
@KetchupOnMyKetchup KetchupOnMyKetchup deleted the ketchup-lrotschy/automaticallyGetNonOriginRemote branch May 3, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work if the GitHub remote is not called origin
2 participants