33module Github.Data.GitData where
44
55import Github.Data.Definitions
6+ import Github.Data.Name (Name )
67
78import Control.DeepSeq (NFData (.. ))
89import Control.DeepSeq.Generics (genericRnf )
@@ -13,7 +14,7 @@ import Data.Vector (Vector)
1314import GHC.Generics (Generic )
1415
1516data Commit = Commit {
16- commitSha :: ! Text
17+ commitSha :: ! ( Name Commit )
1718 ,commitParents :: ! (Vector Tree )
1819 ,commitUrl :: ! Text
1920 ,commitGitCommit :: ! GitCommit
@@ -26,7 +27,7 @@ data Commit = Commit {
2627instance NFData Commit where rnf = genericRnf
2728
2829data Tree = Tree {
29- treeSha :: ! Text
30+ treeSha :: ! ( Name Tree )
3031 ,treeUrl :: ! Text
3132 ,treeGitTrees :: ! (Vector GitTree )
3233} deriving (Show , Data , Typeable , Eq , Ord , Generic )
@@ -35,7 +36,7 @@ instance NFData Tree where rnf = genericRnf
3536
3637data GitTree = GitTree {
3738 gitTreeType :: ! Text
38- ,gitTreeSha :: ! Text
39+ ,gitTreeSha :: ! ( Name GitTree )
3940 -- Can be empty for submodule
4041 ,gitTreeUrl :: ! (Maybe Text )
4142 ,gitTreeSize :: ! (Maybe Int )
@@ -51,7 +52,7 @@ data GitCommit = GitCommit {
5152 ,gitCommitCommitter :: ! GitUser
5253 ,gitCommitAuthor :: ! GitUser
5354 ,gitCommitTree :: ! Tree
54- ,gitCommitSha :: ! (Maybe Text )
55+ ,gitCommitSha :: ! (Maybe ( Name GitCommit ) )
5556 ,gitCommitParents :: ! (Vector Tree )
5657} deriving (Show , Data , Typeable , Eq , Ord , Generic )
5758
@@ -61,7 +62,7 @@ data Blob = Blob {
6162 blobUrl :: ! Text
6263 ,blobEncoding :: ! Text
6364 ,blobContent :: ! Text
64- ,blobSha :: ! Text
65+ ,blobSha :: ! ( Name Blob )
6566 ,blobSize :: ! Int
6667} deriving (Show , Data , Typeable , Eq , Ord , Generic )
6768
@@ -145,7 +146,7 @@ data File = File {
145146 ,fileAdditions :: ! Int
146147 ,fileSha :: ! Text
147148 ,fileChanges :: ! Int
148- ,filePatch :: ! Text
149+ ,filePatch :: ! ( Maybe Text )
149150 ,fileFilename :: ! Text
150151 ,fileDeletions :: ! Int
151152} deriving (Show , Data , Typeable , Eq , Ord , Generic )
0 commit comments