feat(tools): branch_delete
This commit is contained in:
@@ -114,6 +114,15 @@ func (c *Client) ListBranches(ctx context.Context, owner, repo string, page, lim
|
||||
return branches, nil
|
||||
}
|
||||
|
||||
func (c *Client) DeleteBranch(ctx context.Context, owner, repo, branch string) error {
|
||||
p := fmt.Sprintf("/api/v1/repos/%s/%s/branches/%s", owner, repo, branch)
|
||||
body, status, err := c.DeleteJSON(ctx, p)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return MapStatus(status, body)
|
||||
}
|
||||
|
||||
// UpsertFile creates a file when args.Sha is empty (POST) or updates an existing
|
||||
// file when args.Sha is set (PUT). Gitea routes both operations by HTTP method on
|
||||
// the same /contents/{path} URL, and rejects PUT without a sha.
|
||||
|
||||
Reference in New Issue
Block a user