-
Notifications
You must be signed in to change notification settings - Fork 571
build: set remote origin url #1548
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
Conversation
46addba
to
093a68b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, PTAL @tonistiigi
f455b5e
to
ed91c32
Compare
util/gitutil/gitutil.go
Outdated
if ru, err := c.clean(c.run("remote", "get-url", "upstream")); err == nil && ru != "" { | ||
return ru, nil | ||
} | ||
// Otherwise try to get the remote URL from the first remote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just give up here. Using random remote gives random results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's only a single remote it makes sense that we should take that one IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give up like error out or skip setting vcs source in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip. Like we couldn't detect the origin.
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
ed91c32
to
c1058c1
Compare
fixes #1540
By default we use the first remote url when setting vcs url. This change will use origin url. If it fails, fallback to upstream url. Otherwise get the first remote url.
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com