1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
-- | The underlying git references on a Github repo, exposed for the world to
-- see. The git internals documentation will also prove handy for understanding
-- these. API documentation at <http://developer.github.com/v3/git/refs/>.
module Github.GitData.References (
reference
,references
,namespacedReferences
,module Github.Data
) where
import Github.Data
import Github.Private
-- | A single reference by the ref name.
--
-- > reference "mike-burns" "github" "heads/master"
reference :: String -> String -> String -> IO (Either Error GitReference)
reference user repoName ref =
githubGet ["repos", user, repoName, "git", "refs", ref]
-- | The history of references for a repo.
--
-- > references "mike-burns" "github"
references :: String -> String -> IO (Either Error [GitReference])
references user repoName =
githubGet ["repos", user, repoName, "git", "refs"]
-- | Limited references by a namespace.
--
-- > namespacedReferences "thoughtbot" "paperclip" "tags"
namespacedReferences :: String -> String -> String -> IO (Either Error [GitReference])
namespacedReferences user repoName namespace =
githubGet ["repos", user, repoName, "git", "refs", namespace]
|