NewReference creates a new Reference for ref in repo.
(client *github.Client, repo Repository, ref string)
| 18 | |
| 19 | // NewReference creates a new Reference for ref in repo. |
| 20 | func NewReference(client *github.Client, repo Repository, ref string) *Reference { |
| 21 | if !strings.HasPrefix(ref, "refs/") { |
| 22 | ref = fmt.Sprintf("refs/%s", ref) |
| 23 | } |
| 24 | |
| 25 | return &Reference{ |
| 26 | client: client, |
| 27 | owner: repo.Owner, |
| 28 | repo: repo.Name, |
| 29 | ref: ref, |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // Set creates or updates the reference to point to sha. If force is true and |
| 34 | // the reference exists, Set updates it even if the update is not a |
no outgoing calls