client.go: Backport fix RepoPost path (#2100)

Backports #2091 
Fixes #2088
This commit is contained in:
runephilosof-karnovgroup 2023-08-03 10:27:24 +02:00 committed by GitHub
parent dd55261703
commit 64143599f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@ import (
const (
pathSelf = "%s/api/user"
pathRepos = "%s/api/user/repos"
pathRepoPost = "%s/api/repos?forge_remote_id=%d"
pathRepo = "%s/api/repos/%d"
pathRepoLookup = "%s/api/repos/lookup/%s"
pathRepoMove = "%s/api/repos/%d/move?to=%s"
@ -174,7 +175,7 @@ func (c *client) RepoListOpts(sync, all bool) ([]*Repo, error) {
// RepoPost activates a repository.
func (c *client) RepoPost(forgeRemoteID int64) (*Repo, error) {
out := new(Repo)
uri := fmt.Sprintf(pathRepo, c.addr, forgeRemoteID)
uri := fmt.Sprintf(pathRepoPost, c.addr, forgeRemoteID)
err := c.post(uri, nil, out)
return out, err
}