hit-0.4.1: Git operations in haskell

MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone







data Git Source

represent an git repo, with possibly already opened filereaders for indexes and packs

packedNamed :: Git -> PackedRefSource

openRepo :: FilePath -> IO GitSource

open a new git repository context

closeRepo :: Git -> IO ()Source

close a git repository context, closing all remaining fileReaders.

withRepo :: FilePath -> (Git -> IO c) -> IO cSource

execute a function f with a git context.

withCurrentRepo :: (Git -> IO a) -> IO aSource

execute a function on the current repository.

check findRepo to see how the git repository is found.

findRepo :: IO FilePathSource

Find the git repository from the current directory.

If the environment variable GIT_DIR is set then it's used, otherwise iterate from current directory, up to 128 parents for a .git directory

isRepo :: FilePath -> IO BoolSource

basic checks to see if a specific path looks like a git repo.

initRepo :: FilePath -> IO ()Source

initialize a new repository at a specific location.

iterateIndexes :: Git -> (b -> (Ref, PackIndexReader) -> IO (b, Bool)) -> b -> IO bSource

findReference :: Git -> Ref -> IO ObjectLocationSource

Get the object location of a specific reference

findReferencesWithPrefix :: Git -> String -> IO [Ref]Source

get all the references that start by a specific prefix

getting objects

getObjectRaw :: Git -> Ref -> Bool -> IO (Maybe ObjectInfo)Source

get an object from repository

getObjectRawAt :: Git -> ObjectLocation -> Bool -> IO (Maybe ObjectInfo)Source

get an object from repository



:: Git


-> Ref

the object's reference to

-> Bool

whether to resolve deltas if found

-> IO (Maybe Object)

returned object if found

get an object from repository using a ref.

getObjectAt :: Git -> ObjectLocation -> Bool -> IO (Maybe Object)Source

get an object from repository using a location to reference it.

getObjectType :: Git -> Ref -> IO (Maybe ObjectType)Source

get an object type from repository

setting objects

setObject :: Git -> Object -> IO RefSource

set an object in the store and returns the new ref this is always going to create a loose object.