MCPcopy Index your code
hub / github.com/OpenListTeam/OpenList / getBranchHead

Method getBranchHead

drivers/github/driver.go:870–883  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

868}
869
870func (d *Github) getBranchHead() (string, error) {
871 res, err := d.client.R().Get(fmt.Sprintf("https://api.github.com/repos/%s/%s/branches/%s", d.Owner, d.Repo, d.Ref))
872 if err != nil {
873 return "", err
874 }
875 if res.StatusCode() != 200 {
876 return "", toErr(res)
877 }
878 var resp BranchResp
879 if err = utils.Json.Unmarshal(res.Body(), &resp); err != nil {
880 return "", err
881 }
882 return resp.Commit.Sha, nil
883}
884
885func (d *Github) copyWithoutRenewTree(srcObj, dstDir model.Obj) (dstSha, newSha, srcParentSha string, srcParentTree *TreeResp, err error) {
886 dst, err := d.get(dstDir.GetPath())

Callers 2

InitMethod · 0.95
commitMethod · 0.95

Calls 3

toErrFunction · 0.85
GetMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected