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

Simplify IsVendor #19626

Merged
merged 2 commits into from
May 6, 2022
Merged

Simplify IsVendor #19626

merged 2 commits into from
May 6, 2022

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented May 5, 2022

The changes in this file were upstreamed directly into go-enry as go-enry/go-enry#44
and therefore they are no longer needed.

- Use the provided function by go-enry. This file was actually more or
less duplicated code from go-enry: https://github.com/go-enry/go-enry/blob/ed2adad15906ed7f262e64b502eb91de08176314/utils.go#L139-L246
@Gusted Gusted added this to the 1.17.0 milestone May 5, 2022
@Gusted Gusted added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label May 5, 2022
@lunny lunny requested a review from zeripath May 6, 2022 00:59
@wxiaoguang
Copy link
Contributor

wxiaoguang commented May 6, 2022

Wasn't it done by purpose?

Has upstream optimized the code?


Oh Yes! Upstream has the optimization.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 6, 2022
@silverwind
Copy link
Member

IIRC, this optimization was upstreamed into enry, so it might indeed be possible to remove it here. cc @zeripath.

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

Upstream has the optimization already. LGTM

go-enry/go-enry@20726a1

https://github.com/go-enry/go-enry/releases/tag/v2.7.0

Gitea uses: github.com/go-enry/go-enry/v2 v2.7.1

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 6, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 6, 2022
@lafriks
Copy link
Member

lafriks commented May 6, 2022

Yes @zeripath did submit this optimization upstream and it was already merged

@zeripath
Copy link
Contributor

zeripath commented May 6, 2022

No... the go-enry code duplicates this code.

Yes @zeripath did submit this optimization upstream and it was already merged

yup: go-enry/go-enry#44

@zeripath zeripath merged commit 3ece9d5 into go-gitea:main May 6, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 6, 2022
* giteaofficial/main:
  Simplify `IsVendor` (go-gitea#19626)
  Prevent NPE when checking repo units if the user is nil (go-gitea#19625)
  Skip duplicated layers. (go-gitea#19624)
  Add "Reference" section to Issue view sidebar (go-gitea#19609)
  GetFeeds must always discard actions with dangling repo_id (go-gitea#19598)
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 24, 2022
The changes in this file were upstreamed directly into go-enry as go-enry/go-enry#44
and therefore they are no longer needed.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants