Skip to content

fix: prefer upstream over origin when getting remote#366

Merged
lukekarrys merged 1 commit intomainfrom
lk/slimy-deep-megabyte
Sep 18, 2023
Merged

fix: prefer upstream over origin when getting remote#366
lukekarrys merged 1 commit intomainfrom
lk/slimy-deep-megabyte

Conversation

@lukekarrys
Copy link
Contributor

Fixes #363

@lukekarrys lukekarrys requested a review from a team as a code owner September 17, 2023 02:17
const getRemoteUrl = async (path, remote) => {
try {
const urlStr = await tryGit(path, 'remote', 'get-url', 'origin')
const urlStr = await tryGit(path, 'remote', 'get-url', remote)
Copy link
Member

Choose a reason for hiding this comment

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

~/D/n/c/b/main (latest|✔) $ git remote get-url upstream
error: No such remote 'upstream'
~/D/n/c/b/main (latest|✔) $ echo $status
2

does this gracefully handle if it's missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it will return undefined if its missing and then move to the next remote

@lukekarrys lukekarrys merged commit f065bcb into main Sep 18, 2023
@lukekarrys lukekarrys deleted the lk/slimy-deep-megabyte branch September 18, 2023 23:04
@github-actions github-actions bot mentioned this pull request Sep 18, 2023
@rotu
Copy link
Contributor

rotu commented Sep 19, 2023

woohoo! thank you!

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.

package scripts should use upstream, not origin, to set repository.url from git

3 participants