MCPcopy Create free account
hub / github.com/cli/cli / latestCommit

Function latestCommit

pkg/cmd/repo/sync/http.go:27–35  ·  view source on GitHub ↗
(client *api.Client, repo ghrepo.Interface, branch string)

Source from the content-addressed store, hash-verified

25}
26
27func latestCommit(client *api.Client, repo ghrepo.Interface, branch string) (commit, error) {
28 var response commit
29 path, err := safeurl.JoinPath("repos", repo.RepoOwner(), repo.RepoName(), "git", "refs", fmt.Sprintf("heads/%s", branch))
30 if err != nil {
31 return response, err
32 }
33 err = client.REST(repo.RepoHost(), "GET", path.String(), nil, &response)
34 return response, err
35}
36
37type upstreamMergeErr struct{ error }
38

Callers 1

executeRemoteRepoSyncFunction · 0.85

Calls 6

JoinPathFunction · 0.92
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
RESTMethod · 0.65
RepoHostMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected