Add repo branches endpoint (#481)

* add repo branches endpoint

* add branches func to remotes
This commit is contained in:
Anbraten
2021-10-27 02:47:55 +02:00
committed by GitHub
parent 63a93087a1
commit d35f5158bc
11 changed files with 125 additions and 0 deletions

View File

@@ -256,6 +256,12 @@ func (c *client) Deactivate(ctx context.Context, u *model.User, r *model.Repo, l
return nil
}
// Branches returns the names of all branches for the named repository.
func (c *client) Branches(ctx context.Context, u *model.User, r *model.Repo) ([]string, error) {
// TODO: fetch all branches
return []string{r.Branch}, nil
}
// Hook parses the incoming Gogs hook and returns the Repository and Build
// details. If the hook is unsupported nil values are returned.
func (c *client) Hook(r *http.Request) (*model.Repo, *model.Build, error) {