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

test demonstrating relative paths stutter in [storage.XXXX].PATH #26435

Closed
wants to merge 2 commits into from

Conversation

earl-warren
Copy link
Contributor

The following:

[storage.repo-archive]
STORAGE_TYPE = local
PATH = a-relative-path

repeats the relative path

        	            	expected: "/appdata/a-relative-path"
        	            	actual  : "/appdata/a-relative-path/a-relative-path"

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 10, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 10, 2023
@lunny lunny added type/bug backport/v1.20 This PR should be backported to Gitea 1.20 labels Aug 10, 2023
@lunny
Copy link
Member

lunny commented Aug 10, 2023

--- a/modules/setting/storage.go
+++ b/modules/setting/storage.go
@@ -174,7 +174,7 @@ func getStorage(rootCfg ConfigProvider, name, typ string, sec ConfigSection) (*S

        // extra config section will be read SERVE_DIRECT, PATH, MINIO_BASE_PATH, MINIO_BUCKET to override the targetsec when possible
        extraConfigSec := sec
-       if extraConfigSec == nil {
+       if extraConfigSec == nil && !targetSecIsStoragename {
                extraConfigSec = storageNameSec
        }

@lunny lunny added this to the 1.21.0 milestone Aug 10, 2023
@GiteaBot GiteaBot removed this from the 1.21.0 milestone Aug 10, 2023
delvh pushed a commit that referenced this pull request Aug 13, 2023
This PR rewrites the function `getStorage` and make it more clear.

Include tests from #26435, thanks @earl-warren

---------

Co-authored-by: Earl Warren <[email protected]>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Aug 13, 2023
This PR rewrites the function `getStorage` and make it more clear.

Include tests from go-gitea#26435, thanks @earl-warren

---------

Co-authored-by: Earl Warren <[email protected]>
techknowlogick pushed a commit that referenced this pull request Aug 14, 2023
Backport #26441 by @lunny

This PR rewrites the function `getStorage` and make it more clear.

Include tests from #26435, thanks @earl-warren

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Earl Warren <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/v1.20 This PR should be backported to Gitea 1.20 lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants