MCPcopy Index your code
hub / github.com/google/go-github / DeleteRef

Method DeleteRef

github/git_refs.go:178–187  ·  view source on GitHub ↗

DeleteRef deletes a ref from a repository. GitHub API docs: https://docs.github.com/rest/git/refs?apiVersion=2022-11-28#delete-a-reference meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref}

(ctx context.Context, owner, repo, ref string)

Source from the content-addressed store, hash-verified

176//
177//meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref}
178func (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) {
179 ref = strings.TrimPrefix(ref, "refs/")
180 u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref))
181 req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
182 if err != nil {
183 return nil, err
184 }
185
186 return s.client.Do(req, nil)
187}

Callers 1

TestGitService_DeleteRefFunction · 0.80

Calls 3

refURLEscapeFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 1

TestGitService_DeleteRefFunction · 0.64