gitlib-3.1.0: API library for working with Git repositories

Safe HaskellNone

Git.Types

Synopsis

Documentation

class (Applicative m, Monad m, MonadThrow m, IsOid (Oid r), Show (Oid r), Eq (Oid r), Ord (Oid r)) => MonadGit r m | m -> r whereSource

Repository is the central point of contact between user code and Git data objects. Every object must belong to some repository.

Associated Types

type Oid r :: *Source

data Tree r :: *Source

data Options r :: *Source

Methods

facts :: m RepositoryFactsSource

parseOid :: Text -> m (Oid r)Source

getRepository :: m rSource

closeRepository :: m ()Source

deleteRepository :: m ()Source

createReference :: RefName -> RefTarget r -> m ()Source

lookupReference :: RefName -> m (Maybe (RefTarget r))Source

updateReference :: RefName -> RefTarget r -> m ()Source

deleteReference :: RefName -> m ()Source

sourceReferences :: Producer m RefNameSource

lookupObject :: Oid r -> m (Object r m)Source

existsObject :: Oid r -> m BoolSource

sourceObjectsSource

Arguments

:: Maybe (CommitOid r)

A commit we may already have

-> CommitOid r

The commit we need

-> Bool

Include commit trees also?

-> Producer m (ObjectOid r)

All the objects in between

lookupCommit :: CommitOid r -> m (Commit r)Source

lookupTree :: TreeOid r -> m (Tree r)Source

lookupBlob :: BlobOid r -> m (Blob r m)Source

lookupTag :: TagOid r -> m (Tag r)Source

readIndex :: TreeT r m ()Source

writeIndex :: TreeT r m ()Source

newTreeBuilder :: Maybe (Tree r) -> m (TreeBuilder r m)Source

treeOid :: Tree r -> m (TreeOid r)Source

treeEntry :: Tree r -> TreeFilePath -> m (Maybe (TreeEntry r))Source

sourceTreeEntries :: Tree r -> Producer m (TreeFilePath, TreeEntry r)Source

diffContentsWithTree :: Source m (Either TreeFilePath ByteString) -> Tree r -> Producer m ByteStringSource

hashContents :: BlobContents m -> m (BlobOid r)Source

createBlob :: BlobContents m -> m (BlobOid r)Source

createCommit :: [CommitOid r] -> TreeOid r -> Signature -> Signature -> CommitMessage -> Maybe RefName -> m (Commit r)Source

createTag :: CommitOid r -> Signature -> CommitMessage -> Text -> m (Tag r)Source

data RepositoryFactory n m r Source

Constructors

RepositoryFactory 

Fields

openRepository :: RepositoryOptions -> m r
 
runRepository :: forall a. r -> n a -> m a
 
 

class IsOid o whereSource

Instances

type BlobOid r = Tagged r (Oid r)Source

type TreeOid r = Tagged (Tree r) (Oid r)Source

type CommitOid r = Tagged (Commit r) (Oid r)Source

type TagOid r = Tagged (Tag r) (Oid r)Source

parseObjOid :: MonadGit r m => forall o. Text -> m (Tagged o (Oid r))Source

copyOid :: (MonadGit r m, MonadGit s n) => Oid r -> n (Oid s)Source

newtype SHA Source

Constructors

SHA 

Fields

getSHA :: ByteString
 
 

data Blob r m Source

Constructors

Blob 

Fields

blobOid :: !(BlobOid r)
 
blobContents :: !(BlobContents m)
 
 

newtype TreeT r m a Source

Constructors

TreeT 

Fields

runTreeT :: StateT (TreeBuilder r m) m a
 

Instances

MonadTrans (TreeT r) 
Monad m => Monad (TreeT r m) 
Functor m => Functor (TreeT r m) 
MonadFix m => MonadFix (TreeT r m) 
MonadPlus m => MonadPlus (TreeT r m) 
(Functor m, Monad m) => Applicative (TreeT r m) 
(Functor m, MonadPlus m) => Alternative (TreeT r m) 
MonadIO m => MonadIO (TreeT r m) 
MonadLogger m => MonadLogger (TreeT r m) 

data TreeEntry r Source

Constructors

BlobEntry 
TreeEntry 

Fields

treeEntryOid :: !(TreeOid r)
 
CommitEntry 

Fields

commitEntryOid :: !(CommitOid r)
 
 
 

data Tag r Source

Constructors

Tag 

Fields

tagOid :: !(TagOid r)
 
tagCommit :: !(CommitOid r)
 
 

data Object r m Source

Constructors

BlobObj !(Blob r m) 
TreeObj !(Tree r) 
CommitObj !(Commit r) 
TagObj !(Tag r) 

objectOid :: MonadGit r m => Object r m -> m (Oid r)Source

loadObject :: MonadGit r m => ObjectOid r -> m (Object r m)Source

 

data RefTarget r Source

Constructors

RefObj !(Oid r) 
RefSymbolic !RefName