Skip to content

[Backport/v1.15] Escape git fetch remote (#19487) #19728

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

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 3 additions & 49 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,12 @@ trigger:
steps:
- name: deps-frontend
pull: always
image: node:14
image: node:15
commands:
- make node_modules

- name: lint-frontend
image: node:14
commands:
- make lint-frontend
depends_on: [deps-frontend]

- name: lint-backend
pull: always
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
commands:
- make lint-backend
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify

- name: lint-backend-windows
pull: always
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
commands:
- make golangci-lint vet
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify
GOOS: windows
GOARCH: amd64

- name: lint-backend-gogit
pull: always
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
commands:
- make lint-backend
environment:
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
GOSUMDB: sum.golang.org
TAGS: bindata gogit sqlite sqlite_unlock_notify

- name: checks-frontend
image: node:14
image: node:15
commands:
- make checks-frontend
depends_on: [deps-frontend]
Expand All @@ -68,19 +30,11 @@ steps:
image: golang:1.16
commands:
- make checks-backend
depends_on: [lint-backend]

- name: test-frontend
image: node:14
commands:
- make test-frontend
depends_on: [lint-frontend]

- name: build-frontend
image: node:14
image: node:15
commands:
- make frontend
depends_on: [test-frontend]

- name: build-backend-no-gcc
pull: always
Expand Down
1 change: 0 additions & 1 deletion docker/manifest.rootless.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ tags:
{{#each build.tags}}
- {{this}}-rootless
{{/each}}
- "latest-rootless"
{{/if}}
manifests:
-
Expand Down
2 changes: 1 addition & 1 deletion modules/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*models.PullR
}

if ok {
_, err = git.NewCommand("fetch", remote, pr.Head.Ref).RunInDir(g.repo.RepoPath())
_, err = git.NewCommand("fetch", "--no-tags", "--", remote, pr.Head.Ref).RunInDir(g.repo.RepoPath())
if err != nil {
log.Error("Fetch branch from %s failed: %v", pr.Head.CloneURL, err)
} else {
Expand Down