Skip to content

Commit 700a97c

Browse files
Merge pull request #61 from CirnoT/patch-1
Ensure git ref is URI encoded (%2F) for Gitea call
2 parents 5d633c6 + d03954d commit 700a97c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scm/driver/gitea/git.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package gitea
77
import (
88
"context"
99
"fmt"
10+
"net/url"
1011
"time"
1112

1213
"github.com/drone/go-scm/scm"
@@ -24,6 +25,7 @@ func (s *gitService) FindBranch(ctx context.Context, repo, name string) (*scm.Re
2425
}
2526

2627
func (s *gitService) FindCommit(ctx context.Context, repo, ref string) (*scm.Commit, *scm.Response, error) {
28+
ref = url.PathEscape(ref)
2729
path := fmt.Sprintf("api/v1/repos/%s/git/commits/%s", repo, ref)
2830
out := new(commitInfo)
2931
res, err := s.client.do(ctx, "GET", path, nil, out)

0 commit comments

Comments
 (0)