(client *api.Client, repo ghrepo.Interface, branch, SHA string, force bool)
| 66 | } |
| 67 | |
| 68 | func syncFork(client *api.Client, repo ghrepo.Interface, branch, SHA string, force bool) error { |
| 69 | path := fmt.Sprintf("repos/%s/%s/git/refs/heads/%s", repo.RepoOwner(), repo.RepoName(), branch) |
| 70 | body := map[string]interface{}{ |
| 71 | "sha": SHA, |
| 72 | "force": force, |
| 73 | } |
| 74 | requestByte, err := json.Marshal(body) |
| 75 | if err != nil { |
| 76 | return err |
| 77 | } |
| 78 | requestBody := bytes.NewReader(requestByte) |
| 79 | return client.REST(repo.RepoHost(), "PATCH", path, requestBody, nil) |
| 80 | } |
no test coverage detected