Skip to content

Commit e5fbf91

Browse files
committed
add get commit with auth
1 parent a17cfd4 commit e5fbf91

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/GitHub/Endpoints/GitData/Commits.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-- <http://developer.github.com/v3/git/commits/>.
88
module GitHub.Endpoints.GitData.Commits (
99
commit,
10+
commit',
1011
gitCommitR,
1112
module GitHub.Data,
1213
) where
@@ -18,10 +19,16 @@ import Prelude ()
1819

1920
-- | A single commit, by SHA1.
2021
--
22+
23+
-- > reference' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github" "heads/master"
24+
commit' :: Maybe Auth -> Name Owner -> Name Repo -> Name GitCommit -> IO (Either Error GitCommit)
25+
commit' auth user repo sha =
26+
executeRequestMaybe auth $ gitCommitR user repo sha
27+
2128
-- > commit "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"
2229
commit :: Name Owner -> Name Repo -> Name GitCommit -> IO (Either Error GitCommit)
23-
commit user repo sha =
24-
executeRequest' $ gitCommitR user repo sha
30+
commit =
31+
commit' Nothing
2532

2633
-- | Query a commit.
2734
-- See <https://developer.github.com/v3/git/commits/#get-a-commit>

0 commit comments

Comments
 (0)