License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unix |
Safe Haskell | None |
Language | Haskell98 |
Synopsis
- data Git hash
- packedNamed :: Git hash -> CachedPackedRef hash
- gitRepoPath :: Git hash -> LocalPath
- configs :: Git hash -> IORef [Config]
- openRepo :: LocalPath -> IO (Git SHA1)
- closeRepo :: Git hash -> IO ()
- withRepo :: LocalPath -> (Git SHA1 -> IO c) -> IO c
- withCurrentRepo :: (Git SHA1 -> IO a) -> IO a
- findRepoMaybe :: IO (Maybe LocalPath)
- findRepo :: IO LocalPath
- isRepo :: LocalPath -> IO Bool
- initRepo :: LocalPath -> IO ()
- getDescription :: Git hash -> IO (Maybe String)
- setDescription :: Git hash -> String -> IO ()
- iterateIndexes :: HashAlgorithm hash => Git hash -> (b -> (Ref hash, PackIndexReader) -> IO (b, Bool)) -> b -> IO b
- findReference :: HashAlgorithm hash => Git hash -> Ref hash -> IO (ObjectLocation hash)
- findReferencesWithPrefix :: HashAlgorithm hash => Git hash -> String -> IO [Ref hash]
- getObjectRaw :: HashAlgorithm hash => Git hash -> Ref hash -> Bool -> IO (Maybe (ObjectInfo hash))
- getObjectRawAt :: HashAlgorithm hash => Git hash -> ObjectLocation hash -> Bool -> IO (Maybe (ObjectInfo hash))
- getObject :: HashAlgorithm hash => Git hash -> Ref hash -> Bool -> IO (Maybe (Object hash))
- getObject_ :: (Typeable hash, HashAlgorithm hash) => Git hash -> Ref hash -> Bool -> IO (Object hash)
- getObjectAt :: HashAlgorithm hash => Git hash -> ObjectLocation hash -> Bool -> IO (Maybe (Object hash))
- getObjectType :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe ObjectType)
- setObject :: HashAlgorithm hash => Git hash -> Object hash -> IO (Ref hash)
Documentation
represent a git repo, with possibly already opened filereaders for indexes and packs
packedNamed :: Git hash -> CachedPackedRef hash Source #
gitRepoPath :: Git hash -> LocalPath Source #
opening repositories
closeRepo :: Git hash -> IO () Source #
close a git repository context, closing all remaining fileReaders.
withRepo :: LocalPath -> (Git SHA1 -> IO c) -> IO c Source #
execute a function f with a git context.
withCurrentRepo :: (Git SHA1 -> IO a) -> IO a Source #
execute a function on the current repository.
check findRepo to see how the git repository is found.
findRepoMaybe :: IO (Maybe LocalPath) Source #
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
findRepo :: IO LocalPath Source #
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 :: LocalPath -> IO Bool Source #
basic checks to see if a specific path looks like a git repo.
creating repositories
repository accessors
iterators
iterateIndexes :: HashAlgorithm hash => Git hash -> (b -> (Ref hash, PackIndexReader) -> IO (b, Bool)) -> b -> IO b Source #
findReference :: HashAlgorithm hash => Git hash -> Ref hash -> IO (ObjectLocation hash) Source #
Get the object location of a specific reference
findReferencesWithPrefix :: HashAlgorithm hash => Git hash -> String -> IO [Ref hash] Source #
get all the references that start by a specific prefix
getting objects
getObjectRaw :: HashAlgorithm hash => Git hash -> Ref hash -> Bool -> IO (Maybe (ObjectInfo hash)) Source #
get an object from repository
getObjectRawAt :: HashAlgorithm hash => Git hash -> ObjectLocation hash -> Bool -> IO (Maybe (ObjectInfo hash)) Source #
get an object from repository
:: HashAlgorithm hash | |
=> Git hash | repository |
-> Ref hash | the object's reference to |
-> Bool | whether to resolve deltas if found |
-> IO (Maybe (Object hash)) | returned object if found |
get an object from repository using a ref.
:: (Typeable hash, HashAlgorithm hash) | |
=> Git hash | repository |
-> Ref hash | the object's reference to |
-> Bool | whether to resolve deltas if found |
-> IO (Object hash) | returned object if found |
Just like getObject
but will raise a RefNotFound exception if the
reference cannot be found.
getObjectAt :: HashAlgorithm hash => Git hash -> ObjectLocation hash -> Bool -> IO (Maybe (Object hash)) Source #
get an object from repository using a location to reference it.
getObjectType :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe ObjectType) Source #
get an object type from repository