File: Trees.hs

package info (click to toggle)
haskell-github 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 444 kB
  • sloc: haskell: 2,572; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 866 bytes parent folder | download
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
-- | The underlying tree of SHA1s and files that make up a git repo. The API is
-- described on <http://developer.github.com/v3/git/trees/>.
module Github.GitData.Trees (
 tree
,nestedTree
,module Github.Data
) where

import Github.Data
import Github.Private

-- | A tree for a SHA1.
--
-- > tree "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"
tree :: String -> String -> String -> IO (Either Error Tree)
tree user reqRepoName sha =
  githubGet ["repos", user, reqRepoName, "git", "trees", sha]

-- | A recursively-nested tree for a SHA1.
--
-- > nestedTree "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"
nestedTree :: String -> String -> String -> IO (Either Error Tree)
nestedTree user reqRepoName sha =
  githubGetWithQueryString ["repos", user, reqRepoName, "git", "trees", sha]
                           "recursive=1"