{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Represents an existing git repository including all of it\'s
-- object contents.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Ggit.Objects.Repository
    (

-- * Exported types
    Repository(..)                          ,
    IsRepository                            ,
    toRepository                            ,
    noRepository                            ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveRepositoryMethod                 ,
#endif


-- ** addRemoteFetch #method:addRemoteFetch#

#if defined(ENABLE_OVERLOADING)
    RepositoryAddRemoteFetchMethodInfo      ,
#endif
    repositoryAddRemoteFetch                ,


-- ** addRemotePush #method:addRemotePush#

#if defined(ENABLE_OVERLOADING)
    RepositoryAddRemotePushMethodInfo       ,
#endif
    repositoryAddRemotePush                 ,


-- ** blameFile #method:blameFile#

#if defined(ENABLE_OVERLOADING)
    RepositoryBlameFileMethodInfo           ,
#endif
    repositoryBlameFile                     ,


-- ** checkoutHead #method:checkoutHead#

#if defined(ENABLE_OVERLOADING)
    RepositoryCheckoutHeadMethodInfo        ,
#endif
    repositoryCheckoutHead                  ,


-- ** checkoutIndex #method:checkoutIndex#

#if defined(ENABLE_OVERLOADING)
    RepositoryCheckoutIndexMethodInfo       ,
#endif
    repositoryCheckoutIndex                 ,


-- ** checkoutTree #method:checkoutTree#

#if defined(ENABLE_OVERLOADING)
    RepositoryCheckoutTreeMethodInfo        ,
#endif
    repositoryCheckoutTree                  ,


-- ** cherryPick #method:cherryPick#

#if defined(ENABLE_OVERLOADING)
    RepositoryCherryPickMethodInfo          ,
#endif
    repositoryCherryPick                    ,


-- ** cherryPickCommit #method:cherryPickCommit#

#if defined(ENABLE_OVERLOADING)
    RepositoryCherryPickCommitMethodInfo    ,
#endif
    repositoryCherryPickCommit              ,


-- ** clone #method:clone#

    repositoryClone                         ,


-- ** createBlob #method:createBlob#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateBlobMethodInfo          ,
#endif
    repositoryCreateBlob                    ,


-- ** createBlobFromBuffer #method:createBlobFromBuffer#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateBlobFromBufferMethodInfo,
#endif
    repositoryCreateBlobFromBuffer          ,


-- ** createBlobFromFile #method:createBlobFromFile#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateBlobFromFileMethodInfo  ,
#endif
    repositoryCreateBlobFromFile            ,


-- ** createBlobFromPath #method:createBlobFromPath#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateBlobFromPathMethodInfo  ,
#endif
    repositoryCreateBlobFromPath            ,


-- ** createBranch #method:createBranch#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateBranchMethodInfo        ,
#endif
    repositoryCreateBranch                  ,


-- ** createCommit #method:createCommit#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateCommitMethodInfo        ,
#endif
    repositoryCreateCommit                  ,


-- ** createCommitFromIds #method:createCommitFromIds#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateCommitFromIdsMethodInfo ,
#endif
    repositoryCreateCommitFromIds           ,


-- ** createIndexEntryForFile #method:createIndexEntryForFile#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateIndexEntryForFileMethodInfo,
#endif
    repositoryCreateIndexEntryForFile       ,


-- ** createIndexEntryForPath #method:createIndexEntryForPath#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateIndexEntryForPathMethodInfo,
#endif
    repositoryCreateIndexEntryForPath       ,


-- ** createNote #method:createNote#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateNoteMethodInfo          ,
#endif
    repositoryCreateNote                    ,


-- ** createReference #method:createReference#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateReferenceMethodInfo     ,
#endif
    repositoryCreateReference               ,


-- ** createRemote #method:createRemote#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateRemoteMethodInfo        ,
#endif
    repositoryCreateRemote                  ,


-- ** createSymbolicReference #method:createSymbolicReference#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateSymbolicReferenceMethodInfo,
#endif
    repositoryCreateSymbolicReference       ,


-- ** createTag #method:createTag#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateTagMethodInfo           ,
#endif
    repositoryCreateTag                     ,


-- ** createTagAnnotation #method:createTagAnnotation#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateTagAnnotationMethodInfo ,
#endif
    repositoryCreateTagAnnotation           ,


-- ** createTagFromBuffer #method:createTagFromBuffer#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateTagFromBufferMethodInfo ,
#endif
    repositoryCreateTagFromBuffer           ,


-- ** createTagLightweight #method:createTagLightweight#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateTagLightweightMethodInfo,
#endif
    repositoryCreateTagLightweight          ,


-- ** createTreeBuilder #method:createTreeBuilder#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateTreeBuilderMethodInfo   ,
#endif
    repositoryCreateTreeBuilder             ,


-- ** createTreeBuilderFromTree #method:createTreeBuilderFromTree#

#if defined(ENABLE_OVERLOADING)
    RepositoryCreateTreeBuilderFromTreeMethodInfo,
#endif
    repositoryCreateTreeBuilderFromTree     ,


-- ** deleteTag #method:deleteTag#

#if defined(ENABLE_OVERLOADING)
    RepositoryDeleteTagMethodInfo           ,
#endif
    repositoryDeleteTag                     ,


-- ** discover #method:discover#

    repositoryDiscover                      ,


-- ** discoverFull #method:discoverFull#

    repositoryDiscoverFull                  ,


-- ** dropStash #method:dropStash#

#if defined(ENABLE_OVERLOADING)
    RepositoryDropStashMethodInfo           ,
#endif
    repositoryDropStash                     ,


-- ** enumerateBranches #method:enumerateBranches#

#if defined(ENABLE_OVERLOADING)
    RepositoryEnumerateBranchesMethodInfo   ,
#endif
    repositoryEnumerateBranches             ,


-- ** fileStatus #method:fileStatus#

#if defined(ENABLE_OVERLOADING)
    RepositoryFileStatusMethodInfo          ,
#endif
    repositoryFileStatus                    ,


-- ** fileStatusForeach #method:fileStatusForeach#

#if defined(ENABLE_OVERLOADING)
    RepositoryFileStatusForeachMethodInfo   ,
#endif
    repositoryFileStatusForeach             ,


-- ** getAheadBehind #method:getAheadBehind#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetAheadBehindMethodInfo      ,
#endif
    repositoryGetAheadBehind                ,


-- ** getAttribute #method:getAttribute#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetAttributeMethodInfo        ,
#endif
    repositoryGetAttribute                  ,


-- ** getConfig #method:getConfig#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetConfigMethodInfo           ,
#endif
    repositoryGetConfig                     ,


-- ** getDefaultNotesRef #method:getDefaultNotesRef#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetDefaultNotesRefMethodInfo  ,
#endif
    repositoryGetDefaultNotesRef            ,


-- ** getDescendantOf #method:getDescendantOf#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetDescendantOfMethodInfo     ,
#endif
    repositoryGetDescendantOf               ,


-- ** getHead #method:getHead#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetHeadMethodInfo             ,
#endif
    repositoryGetHead                       ,


-- ** getIndex #method:getIndex#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetIndexMethodInfo            ,
#endif
    repositoryGetIndex                      ,


-- ** getLocation #method:getLocation#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetLocationMethodInfo         ,
#endif
    repositoryGetLocation                   ,


-- ** getSubmoduleStatus #method:getSubmoduleStatus#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetSubmoduleStatusMethodInfo  ,
#endif
    repositoryGetSubmoduleStatus            ,


-- ** getWorkdir #method:getWorkdir#

#if defined(ENABLE_OVERLOADING)
    RepositoryGetWorkdirMethodInfo          ,
#endif
    repositoryGetWorkdir                    ,


-- ** initRepository #method:initRepository#

    repositoryInitRepository                ,


-- ** isBare #method:isBare#

#if defined(ENABLE_OVERLOADING)
    RepositoryIsBareMethodInfo              ,
#endif
    repositoryIsBare                        ,


-- ** isEmpty #method:isEmpty#

#if defined(ENABLE_OVERLOADING)
    RepositoryIsEmptyMethodInfo             ,
#endif
    repositoryIsEmpty                       ,


-- ** isHeadDetached #method:isHeadDetached#

#if defined(ENABLE_OVERLOADING)
    RepositoryIsHeadDetachedMethodInfo      ,
#endif
    repositoryIsHeadDetached                ,


-- ** isHeadUnborn #method:isHeadUnborn#

#if defined(ENABLE_OVERLOADING)
    RepositoryIsHeadUnbornMethodInfo        ,
#endif
    repositoryIsHeadUnborn                  ,


-- ** listRemotes #method:listRemotes#

#if defined(ENABLE_OVERLOADING)
    RepositoryListRemotesMethodInfo         ,
#endif
    repositoryListRemotes                   ,


-- ** listTags #method:listTags#

#if defined(ENABLE_OVERLOADING)
    RepositoryListTagsMethodInfo            ,
#endif
    repositoryListTags                      ,


-- ** listTagsMatch #method:listTagsMatch#

#if defined(ENABLE_OVERLOADING)
    RepositoryListTagsMatchMethodInfo       ,
#endif
    repositoryListTagsMatch                 ,


-- ** lookup #method:lookup#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupMethodInfo              ,
#endif
    repositoryLookup                        ,


-- ** lookupBlob #method:lookupBlob#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupBlobMethodInfo          ,
#endif
    repositoryLookupBlob                    ,


-- ** lookupBranch #method:lookupBranch#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupBranchMethodInfo        ,
#endif
    repositoryLookupBranch                  ,


-- ** lookupCommit #method:lookupCommit#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupCommitMethodInfo        ,
#endif
    repositoryLookupCommit                  ,


-- ** lookupReference #method:lookupReference#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupReferenceMethodInfo     ,
#endif
    repositoryLookupReference               ,


-- ** lookupReferenceDwim #method:lookupReferenceDwim#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupReferenceDwimMethodInfo ,
#endif
    repositoryLookupReferenceDwim           ,


-- ** lookupRemote #method:lookupRemote#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupRemoteMethodInfo        ,
#endif
    repositoryLookupRemote                  ,


-- ** lookupSubmodule #method:lookupSubmodule#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupSubmoduleMethodInfo     ,
#endif
    repositoryLookupSubmodule               ,


-- ** lookupTag #method:lookupTag#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupTagMethodInfo           ,
#endif
    repositoryLookupTag                     ,


-- ** lookupTree #method:lookupTree#

#if defined(ENABLE_OVERLOADING)
    RepositoryLookupTreeMethodInfo          ,
#endif
    repositoryLookupTree                    ,


-- ** merge #method:merge#

#if defined(ENABLE_OVERLOADING)
    RepositoryMergeMethodInfo               ,
#endif
    repositoryMerge                         ,


-- ** mergeBase #method:mergeBase#

#if defined(ENABLE_OVERLOADING)
    RepositoryMergeBaseMethodInfo           ,
#endif
    repositoryMergeBase                     ,


-- ** mergeCommits #method:mergeCommits#

#if defined(ENABLE_OVERLOADING)
    RepositoryMergeCommitsMethodInfo        ,
#endif
    repositoryMergeCommits                  ,


-- ** mergeTrees #method:mergeTrees#

#if defined(ENABLE_OVERLOADING)
    RepositoryMergeTreesMethodInfo          ,
#endif
    repositoryMergeTrees                    ,


-- ** noteForeach #method:noteForeach#

#if defined(ENABLE_OVERLOADING)
    RepositoryNoteForeachMethodInfo         ,
#endif
    repositoryNoteForeach                   ,


-- ** open #method:open#

    repositoryOpen                          ,


-- ** pathIsIgnored #method:pathIsIgnored#

#if defined(ENABLE_OVERLOADING)
    RepositoryPathIsIgnoredMethodInfo       ,
#endif
    repositoryPathIsIgnored                 ,


-- ** readNote #method:readNote#

#if defined(ENABLE_OVERLOADING)
    RepositoryReadNoteMethodInfo            ,
#endif
    repositoryReadNote                      ,


-- ** rebaseInit #method:rebaseInit#

#if defined(ENABLE_OVERLOADING)
    RepositoryRebaseInitMethodInfo          ,
#endif
    repositoryRebaseInit                    ,


-- ** rebaseOpen #method:rebaseOpen#

#if defined(ENABLE_OVERLOADING)
    RepositoryRebaseOpenMethodInfo          ,
#endif
    repositoryRebaseOpen                    ,


-- ** referencesForeach #method:referencesForeach#

#if defined(ENABLE_OVERLOADING)
    RepositoryReferencesForeachMethodInfo   ,
#endif
    repositoryReferencesForeach             ,


-- ** referencesForeachName #method:referencesForeachName#

#if defined(ENABLE_OVERLOADING)
    RepositoryReferencesForeachNameMethodInfo,
#endif
    repositoryReferencesForeachName         ,


-- ** removeNote #method:removeNote#

#if defined(ENABLE_OVERLOADING)
    RepositoryRemoveNoteMethodInfo          ,
#endif
    repositoryRemoveNote                    ,


-- ** removeRemote #method:removeRemote#

#if defined(ENABLE_OVERLOADING)
    RepositoryRemoveRemoteMethodInfo        ,
#endif
    repositoryRemoveRemote                  ,


-- ** renameRemote #method:renameRemote#

#if defined(ENABLE_OVERLOADING)
    RepositoryRenameRemoteMethodInfo        ,
#endif
    repositoryRenameRemote                  ,


-- ** reset #method:reset#

#if defined(ENABLE_OVERLOADING)
    RepositoryResetMethodInfo               ,
#endif
    repositoryReset                         ,


-- ** resetDefault #method:resetDefault#

#if defined(ENABLE_OVERLOADING)
    RepositoryResetDefaultMethodInfo        ,
#endif
    repositoryResetDefault                  ,


-- ** revert #method:revert#

#if defined(ENABLE_OVERLOADING)
    RepositoryRevertMethodInfo              ,
#endif
    repositoryRevert                        ,


-- ** revparse #method:revparse#

#if defined(ENABLE_OVERLOADING)
    RepositoryRevparseMethodInfo            ,
#endif
    repositoryRevparse                      ,


-- ** saveStash #method:saveStash#

#if defined(ENABLE_OVERLOADING)
    RepositorySaveStashMethodInfo           ,
#endif
    repositorySaveStash                     ,


-- ** setHead #method:setHead#

#if defined(ENABLE_OVERLOADING)
    RepositorySetHeadMethodInfo             ,
#endif
    repositorySetHead                       ,


-- ** setRemoteUrl #method:setRemoteUrl#

#if defined(ENABLE_OVERLOADING)
    RepositorySetRemoteUrlMethodInfo        ,
#endif
    repositorySetRemoteUrl                  ,


-- ** setSubmoduleFetchRecurse #method:setSubmoduleFetchRecurse#

#if defined(ENABLE_OVERLOADING)
    RepositorySetSubmoduleFetchRecurseMethodInfo,
#endif
    repositorySetSubmoduleFetchRecurse      ,


-- ** setSubmoduleIgnore #method:setSubmoduleIgnore#

#if defined(ENABLE_OVERLOADING)
    RepositorySetSubmoduleIgnoreMethodInfo  ,
#endif
    repositorySetSubmoduleIgnore            ,


-- ** setSubmoduleUpdate #method:setSubmoduleUpdate#

#if defined(ENABLE_OVERLOADING)
    RepositorySetSubmoduleUpdateMethodInfo  ,
#endif
    repositorySetSubmoduleUpdate            ,


-- ** setSubmoduleUrl #method:setSubmoduleUrl#

#if defined(ENABLE_OVERLOADING)
    RepositorySetSubmoduleUrlMethodInfo     ,
#endif
    repositorySetSubmoduleUrl               ,


-- ** setWorkdir #method:setWorkdir#

#if defined(ENABLE_OVERLOADING)
    RepositorySetWorkdirMethodInfo          ,
#endif
    repositorySetWorkdir                    ,


-- ** stashForeach #method:stashForeach#

#if defined(ENABLE_OVERLOADING)
    RepositoryStashForeachMethodInfo        ,
#endif
    repositoryStashForeach                  ,


-- ** submoduleForeach #method:submoduleForeach#

#if defined(ENABLE_OVERLOADING)
    RepositorySubmoduleForeachMethodInfo    ,
#endif
    repositorySubmoduleForeach              ,


-- ** tagForeach #method:tagForeach#

#if defined(ENABLE_OVERLOADING)
    RepositoryTagForeachMethodInfo          ,
#endif
    repositoryTagForeach                    ,




 -- * Properties
-- ** cloneOptions #attr:cloneOptions#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryCloneOptionsPropertyInfo      ,
#endif
    constructRepositoryCloneOptions         ,
    getRepositoryCloneOptions               ,
#if defined(ENABLE_OVERLOADING)
    repositoryCloneOptions                  ,
#endif


-- ** head #attr:head#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryHeadPropertyInfo              ,
#endif
    getRepositoryHead                       ,
#if defined(ENABLE_OVERLOADING)
    repositoryHead                          ,
#endif


-- ** init #attr:init#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryInitPropertyInfo              ,
#endif
    constructRepositoryInit                 ,
    getRepositoryInit                       ,
#if defined(ENABLE_OVERLOADING)
    repositoryInit                          ,
#endif


-- ** isBare #attr:isBare#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryIsBarePropertyInfo            ,
#endif
    constructRepositoryIsBare               ,
    getRepositoryIsBare                     ,


-- ** location #attr:location#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryLocationPropertyInfo          ,
#endif
    constructRepositoryLocation             ,
    getRepositoryLocation                   ,
#if defined(ENABLE_OVERLOADING)
    repositoryLocation                      ,
#endif


-- ** url #attr:url#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryUrlPropertyInfo               ,
#endif
    constructRepositoryUrl                  ,
    getRepositoryUrl                        ,
#if defined(ENABLE_OVERLOADING)
    repositoryUrl                           ,
#endif


-- ** workdir #attr:workdir#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    RepositoryWorkdirPropertyInfo           ,
#endif
    clearRepositoryWorkdir                  ,
    constructRepositoryWorkdir              ,
    getRepositoryWorkdir                    ,
#if defined(ENABLE_OVERLOADING)
    repositoryWorkdir                       ,
#endif
    setRepositoryWorkdir                    ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Ggit.Callbacks as Ggit.Callbacks
import {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Flags as Ggit.Flags
import {-# SOURCE #-} qualified GI.Ggit.Objects.Blame as Ggit.Blame
import {-# SOURCE #-} qualified GI.Ggit.Objects.Blob as Ggit.Blob
import {-# SOURCE #-} qualified GI.Ggit.Objects.BlobOutputStream as Ggit.BlobOutputStream
import {-# SOURCE #-} qualified GI.Ggit.Objects.Branch as Ggit.Branch
import {-# SOURCE #-} qualified GI.Ggit.Objects.CheckoutOptions as Ggit.CheckoutOptions
import {-# SOURCE #-} qualified GI.Ggit.Objects.CherryPickOptions as Ggit.CherryPickOptions
import {-# SOURCE #-} qualified GI.Ggit.Objects.CloneOptions as Ggit.CloneOptions
import {-# SOURCE #-} qualified GI.Ggit.Objects.Commit as Ggit.Commit
import {-# SOURCE #-} qualified GI.Ggit.Objects.Config as Ggit.Config
import {-# SOURCE #-} qualified GI.Ggit.Objects.Index as Ggit.Index
import {-# SOURCE #-} qualified GI.Ggit.Objects.Native as Ggit.Native
import {-# SOURCE #-} qualified GI.Ggit.Objects.Object as Ggit.Object
import {-# SOURCE #-} qualified GI.Ggit.Objects.ObjectFactoryBase as Ggit.ObjectFactoryBase
import {-# SOURCE #-} qualified GI.Ggit.Objects.Rebase as Ggit.Rebase
import {-# SOURCE #-} qualified GI.Ggit.Objects.Ref as Ggit.Ref
import {-# SOURCE #-} qualified GI.Ggit.Objects.Remote as Ggit.Remote
import {-# SOURCE #-} qualified GI.Ggit.Objects.Signature as Ggit.Signature
import {-# SOURCE #-} qualified GI.Ggit.Objects.Tag as Ggit.Tag
import {-# SOURCE #-} qualified GI.Ggit.Objects.Tree as Ggit.Tree
import {-# SOURCE #-} qualified GI.Ggit.Objects.TreeBuilder as Ggit.TreeBuilder
import {-# SOURCE #-} qualified GI.Ggit.Structs.AnnotatedCommit as Ggit.AnnotatedCommit
import {-# SOURCE #-} qualified GI.Ggit.Structs.BlameOptions as Ggit.BlameOptions
import {-# SOURCE #-} qualified GI.Ggit.Structs.BranchEnumerator as Ggit.BranchEnumerator
import {-# SOURCE #-} qualified GI.Ggit.Structs.IndexEntry as Ggit.IndexEntry
import {-# SOURCE #-} qualified GI.Ggit.Structs.MergeOptions as Ggit.MergeOptions
import {-# SOURCE #-} qualified GI.Ggit.Structs.Note as Ggit.Note
import {-# SOURCE #-} qualified GI.Ggit.Structs.OId as Ggit.OId
import {-# SOURCE #-} qualified GI.Ggit.Structs.RebaseOptions as Ggit.RebaseOptions
import {-# SOURCE #-} qualified GI.Ggit.Structs.RevertOptions as Ggit.RevertOptions
import {-# SOURCE #-} qualified GI.Ggit.Structs.StatusOptions as Ggit.StatusOptions
import {-# SOURCE #-} qualified GI.Ggit.Structs.Submodule as Ggit.Submodule
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable

-- | Memory-managed wrapper type.
newtype Repository = Repository (ManagedPtr Repository)
    deriving (Eq)
foreign import ccall "ggit_repository_get_type"
    c_ggit_repository_get_type :: IO GType

instance GObject Repository where
    gobjectType = c_ggit_repository_get_type


-- | Convert 'Repository' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Repository where
    toGValue o = do
        gtype <- c_ggit_repository_get_type
        B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)

    fromGValue gv = do
        ptr <- B.GValue.get_object gv :: IO (Ptr Repository)
        B.ManagedPtr.newObject Repository ptr



-- | Type class for types which can be safely cast to `Repository`, for instance with `toRepository`.
class (GObject o, O.IsDescendantOf Repository o) => IsRepository o
instance (GObject o, O.IsDescendantOf Repository o) => IsRepository o

instance O.HasParentTypes Repository
type instance O.ParentTypes Repository = '[Ggit.Native.Native, Ggit.ObjectFactoryBase.ObjectFactoryBase, GObject.Object.Object, Gio.Initable.Initable]

-- | Cast to `Repository`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toRepository :: (MonadIO m, IsRepository o) => o -> m Repository
toRepository = liftIO . unsafeCastTo Repository

-- | A convenience alias for `Nothing` :: `Maybe` `Repository`.
noRepository :: Maybe Repository
noRepository = Nothing

#if defined(ENABLE_OVERLOADING)
type family ResolveRepositoryMethod (t :: Symbol) (o :: *) :: * where
    ResolveRepositoryMethod "addRemoteFetch" o = RepositoryAddRemoteFetchMethodInfo
    ResolveRepositoryMethod "addRemotePush" o = RepositoryAddRemotePushMethodInfo
    ResolveRepositoryMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveRepositoryMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveRepositoryMethod "blameFile" o = RepositoryBlameFileMethodInfo
    ResolveRepositoryMethod "checkoutHead" o = RepositoryCheckoutHeadMethodInfo
    ResolveRepositoryMethod "checkoutIndex" o = RepositoryCheckoutIndexMethodInfo
    ResolveRepositoryMethod "checkoutTree" o = RepositoryCheckoutTreeMethodInfo
    ResolveRepositoryMethod "cherryPick" o = RepositoryCherryPickMethodInfo
    ResolveRepositoryMethod "cherryPickCommit" o = RepositoryCherryPickCommitMethodInfo
    ResolveRepositoryMethod "createBlob" o = RepositoryCreateBlobMethodInfo
    ResolveRepositoryMethod "createBlobFromBuffer" o = RepositoryCreateBlobFromBufferMethodInfo
    ResolveRepositoryMethod "createBlobFromFile" o = RepositoryCreateBlobFromFileMethodInfo
    ResolveRepositoryMethod "createBlobFromPath" o = RepositoryCreateBlobFromPathMethodInfo
    ResolveRepositoryMethod "createBranch" o = RepositoryCreateBranchMethodInfo
    ResolveRepositoryMethod "createCommit" o = RepositoryCreateCommitMethodInfo
    ResolveRepositoryMethod "createCommitFromIds" o = RepositoryCreateCommitFromIdsMethodInfo
    ResolveRepositoryMethod "createIndexEntryForFile" o = RepositoryCreateIndexEntryForFileMethodInfo
    ResolveRepositoryMethod "createIndexEntryForPath" o = RepositoryCreateIndexEntryForPathMethodInfo
    ResolveRepositoryMethod "createNote" o = RepositoryCreateNoteMethodInfo
    ResolveRepositoryMethod "createReference" o = RepositoryCreateReferenceMethodInfo
    ResolveRepositoryMethod "createRemote" o = RepositoryCreateRemoteMethodInfo
    ResolveRepositoryMethod "createSymbolicReference" o = RepositoryCreateSymbolicReferenceMethodInfo
    ResolveRepositoryMethod "createTag" o = RepositoryCreateTagMethodInfo
    ResolveRepositoryMethod "createTagAnnotation" o = RepositoryCreateTagAnnotationMethodInfo
    ResolveRepositoryMethod "createTagFromBuffer" o = RepositoryCreateTagFromBufferMethodInfo
    ResolveRepositoryMethod "createTagLightweight" o = RepositoryCreateTagLightweightMethodInfo
    ResolveRepositoryMethod "createTreeBuilder" o = RepositoryCreateTreeBuilderMethodInfo
    ResolveRepositoryMethod "createTreeBuilderFromTree" o = RepositoryCreateTreeBuilderFromTreeMethodInfo
    ResolveRepositoryMethod "deleteTag" o = RepositoryDeleteTagMethodInfo
    ResolveRepositoryMethod "dropStash" o = RepositoryDropStashMethodInfo
    ResolveRepositoryMethod "enumerateBranches" o = RepositoryEnumerateBranchesMethodInfo
    ResolveRepositoryMethod "fileStatus" o = RepositoryFileStatusMethodInfo
    ResolveRepositoryMethod "fileStatusForeach" o = RepositoryFileStatusForeachMethodInfo
    ResolveRepositoryMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveRepositoryMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveRepositoryMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveRepositoryMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveRepositoryMethod "isBare" o = RepositoryIsBareMethodInfo
    ResolveRepositoryMethod "isEmpty" o = RepositoryIsEmptyMethodInfo
    ResolveRepositoryMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveRepositoryMethod "isHeadDetached" o = RepositoryIsHeadDetachedMethodInfo
    ResolveRepositoryMethod "isHeadUnborn" o = RepositoryIsHeadUnbornMethodInfo
    ResolveRepositoryMethod "listRemotes" o = RepositoryListRemotesMethodInfo
    ResolveRepositoryMethod "listTags" o = RepositoryListTagsMethodInfo
    ResolveRepositoryMethod "listTagsMatch" o = RepositoryListTagsMatchMethodInfo
    ResolveRepositoryMethod "lookup" o = RepositoryLookupMethodInfo
    ResolveRepositoryMethod "lookupBlob" o = RepositoryLookupBlobMethodInfo
    ResolveRepositoryMethod "lookupBranch" o = RepositoryLookupBranchMethodInfo
    ResolveRepositoryMethod "lookupCommit" o = RepositoryLookupCommitMethodInfo
    ResolveRepositoryMethod "lookupReference" o = RepositoryLookupReferenceMethodInfo
    ResolveRepositoryMethod "lookupReferenceDwim" o = RepositoryLookupReferenceDwimMethodInfo
    ResolveRepositoryMethod "lookupRemote" o = RepositoryLookupRemoteMethodInfo
    ResolveRepositoryMethod "lookupSubmodule" o = RepositoryLookupSubmoduleMethodInfo
    ResolveRepositoryMethod "lookupTag" o = RepositoryLookupTagMethodInfo
    ResolveRepositoryMethod "lookupTree" o = RepositoryLookupTreeMethodInfo
    ResolveRepositoryMethod "merge" o = RepositoryMergeMethodInfo
    ResolveRepositoryMethod "mergeBase" o = RepositoryMergeBaseMethodInfo
    ResolveRepositoryMethod "mergeCommits" o = RepositoryMergeCommitsMethodInfo
    ResolveRepositoryMethod "mergeTrees" o = RepositoryMergeTreesMethodInfo
    ResolveRepositoryMethod "noteForeach" o = RepositoryNoteForeachMethodInfo
    ResolveRepositoryMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveRepositoryMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveRepositoryMethod "pathIsIgnored" o = RepositoryPathIsIgnoredMethodInfo
    ResolveRepositoryMethod "readNote" o = RepositoryReadNoteMethodInfo
    ResolveRepositoryMethod "rebaseInit" o = RepositoryRebaseInitMethodInfo
    ResolveRepositoryMethod "rebaseOpen" o = RepositoryRebaseOpenMethodInfo
    ResolveRepositoryMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveRepositoryMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveRepositoryMethod "referencesForeach" o = RepositoryReferencesForeachMethodInfo
    ResolveRepositoryMethod "referencesForeachName" o = RepositoryReferencesForeachNameMethodInfo
    ResolveRepositoryMethod "removeNote" o = RepositoryRemoveNoteMethodInfo
    ResolveRepositoryMethod "removeRemote" o = RepositoryRemoveRemoteMethodInfo
    ResolveRepositoryMethod "renameRemote" o = RepositoryRenameRemoteMethodInfo
    ResolveRepositoryMethod "reset" o = RepositoryResetMethodInfo
    ResolveRepositoryMethod "resetDefault" o = RepositoryResetDefaultMethodInfo
    ResolveRepositoryMethod "revert" o = RepositoryRevertMethodInfo
    ResolveRepositoryMethod "revparse" o = RepositoryRevparseMethodInfo
    ResolveRepositoryMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveRepositoryMethod "saveStash" o = RepositorySaveStashMethodInfo
    ResolveRepositoryMethod "stashForeach" o = RepositoryStashForeachMethodInfo
    ResolveRepositoryMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveRepositoryMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveRepositoryMethod "submoduleForeach" o = RepositorySubmoduleForeachMethodInfo
    ResolveRepositoryMethod "tagForeach" o = RepositoryTagForeachMethodInfo
    ResolveRepositoryMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveRepositoryMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveRepositoryMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveRepositoryMethod "getAheadBehind" o = RepositoryGetAheadBehindMethodInfo
    ResolveRepositoryMethod "getAttribute" o = RepositoryGetAttributeMethodInfo
    ResolveRepositoryMethod "getConfig" o = RepositoryGetConfigMethodInfo
    ResolveRepositoryMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveRepositoryMethod "getDefaultNotesRef" o = RepositoryGetDefaultNotesRefMethodInfo
    ResolveRepositoryMethod "getDescendantOf" o = RepositoryGetDescendantOfMethodInfo
    ResolveRepositoryMethod "getHead" o = RepositoryGetHeadMethodInfo
    ResolveRepositoryMethod "getIndex" o = RepositoryGetIndexMethodInfo
    ResolveRepositoryMethod "getLocation" o = RepositoryGetLocationMethodInfo
    ResolveRepositoryMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveRepositoryMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveRepositoryMethod "getSubmoduleStatus" o = RepositoryGetSubmoduleStatusMethodInfo
    ResolveRepositoryMethod "getWorkdir" o = RepositoryGetWorkdirMethodInfo
    ResolveRepositoryMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveRepositoryMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveRepositoryMethod "setHead" o = RepositorySetHeadMethodInfo
    ResolveRepositoryMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveRepositoryMethod "setRemoteUrl" o = RepositorySetRemoteUrlMethodInfo
    ResolveRepositoryMethod "setSubmoduleFetchRecurse" o = RepositorySetSubmoduleFetchRecurseMethodInfo
    ResolveRepositoryMethod "setSubmoduleIgnore" o = RepositorySetSubmoduleIgnoreMethodInfo
    ResolveRepositoryMethod "setSubmoduleUpdate" o = RepositorySetSubmoduleUpdateMethodInfo
    ResolveRepositoryMethod "setSubmoduleUrl" o = RepositorySetSubmoduleUrlMethodInfo
    ResolveRepositoryMethod "setWorkdir" o = RepositorySetWorkdirMethodInfo
    ResolveRepositoryMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveRepositoryMethod t Repository, O.MethodInfo info Repository p) => OL.IsLabel t (Repository -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

-- VVV Prop "clone-options"
   -- Type: TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@clone-options@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #cloneOptions
-- @
getRepositoryCloneOptions :: (MonadIO m, IsRepository o) => o -> m (Maybe Ggit.CloneOptions.CloneOptions)
getRepositoryCloneOptions obj = liftIO $ B.Properties.getObjectPropertyObject obj "clone-options" Ggit.CloneOptions.CloneOptions

-- | Construct a `GValueConstruct` with valid value for the “@clone-options@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepositoryCloneOptions :: (IsRepository o, Ggit.CloneOptions.IsCloneOptions a) => a -> IO (GValueConstruct o)
constructRepositoryCloneOptions val = B.Properties.constructObjectPropertyObject "clone-options" (Just val)

#if defined(ENABLE_OVERLOADING)
data RepositoryCloneOptionsPropertyInfo
instance AttrInfo RepositoryCloneOptionsPropertyInfo where
    type AttrAllowedOps RepositoryCloneOptionsPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepositoryCloneOptionsPropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryCloneOptionsPropertyInfo = Ggit.CloneOptions.IsCloneOptions
    type AttrTransferTypeConstraint RepositoryCloneOptionsPropertyInfo = Ggit.CloneOptions.IsCloneOptions
    type AttrTransferType RepositoryCloneOptionsPropertyInfo = Ggit.CloneOptions.CloneOptions
    type AttrGetType RepositoryCloneOptionsPropertyInfo = (Maybe Ggit.CloneOptions.CloneOptions)
    type AttrLabel RepositoryCloneOptionsPropertyInfo = "clone-options"
    type AttrOrigin RepositoryCloneOptionsPropertyInfo = Repository
    attrGet = getRepositoryCloneOptions
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Ggit.CloneOptions.CloneOptions v
    attrConstruct = constructRepositoryCloneOptions
    attrClear = undefined
#endif

-- VVV Prop "head"
   -- Type: TInterface (Name {namespace = "Ggit", name = "Ref"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@head@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #head
-- @
getRepositoryHead :: (MonadIO m, IsRepository o) => o -> m (Maybe Ggit.Ref.Ref)
getRepositoryHead obj = liftIO $ B.Properties.getObjectPropertyObject obj "head" Ggit.Ref.Ref

#if defined(ENABLE_OVERLOADING)
data RepositoryHeadPropertyInfo
instance AttrInfo RepositoryHeadPropertyInfo where
    type AttrAllowedOps RepositoryHeadPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepositoryHeadPropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryHeadPropertyInfo = (~) ()
    type AttrTransferTypeConstraint RepositoryHeadPropertyInfo = (~) ()
    type AttrTransferType RepositoryHeadPropertyInfo = ()
    type AttrGetType RepositoryHeadPropertyInfo = (Maybe Ggit.Ref.Ref)
    type AttrLabel RepositoryHeadPropertyInfo = "head"
    type AttrOrigin RepositoryHeadPropertyInfo = Repository
    attrGet = getRepositoryHead
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
#endif

-- VVV Prop "init"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@init@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #init
-- @
getRepositoryInit :: (MonadIO m, IsRepository o) => o -> m Bool
getRepositoryInit obj = liftIO $ B.Properties.getObjectPropertyBool obj "init"

-- | Construct a `GValueConstruct` with valid value for the “@init@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepositoryInit :: (IsRepository o) => Bool -> IO (GValueConstruct o)
constructRepositoryInit val = B.Properties.constructObjectPropertyBool "init" val

#if defined(ENABLE_OVERLOADING)
data RepositoryInitPropertyInfo
instance AttrInfo RepositoryInitPropertyInfo where
    type AttrAllowedOps RepositoryInitPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint RepositoryInitPropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryInitPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint RepositoryInitPropertyInfo = (~) Bool
    type AttrTransferType RepositoryInitPropertyInfo = Bool
    type AttrGetType RepositoryInitPropertyInfo = Bool
    type AttrLabel RepositoryInitPropertyInfo = "init"
    type AttrOrigin RepositoryInitPropertyInfo = Repository
    attrGet = getRepositoryInit
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructRepositoryInit
    attrClear = undefined
#endif

-- VVV Prop "is-bare"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@is-bare@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #isBare
-- @
getRepositoryIsBare :: (MonadIO m, IsRepository o) => o -> m Bool
getRepositoryIsBare obj = liftIO $ B.Properties.getObjectPropertyBool obj "is-bare"

-- | Construct a `GValueConstruct` with valid value for the “@is-bare@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepositoryIsBare :: (IsRepository o) => Bool -> IO (GValueConstruct o)
constructRepositoryIsBare val = B.Properties.constructObjectPropertyBool "is-bare" val

#if defined(ENABLE_OVERLOADING)
data RepositoryIsBarePropertyInfo
instance AttrInfo RepositoryIsBarePropertyInfo where
    type AttrAllowedOps RepositoryIsBarePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint RepositoryIsBarePropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryIsBarePropertyInfo = (~) Bool
    type AttrTransferTypeConstraint RepositoryIsBarePropertyInfo = (~) Bool
    type AttrTransferType RepositoryIsBarePropertyInfo = Bool
    type AttrGetType RepositoryIsBarePropertyInfo = Bool
    type AttrLabel RepositoryIsBarePropertyInfo = "is-bare"
    type AttrOrigin RepositoryIsBarePropertyInfo = Repository
    attrGet = getRepositoryIsBare
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructRepositoryIsBare
    attrClear = undefined
#endif

-- VVV Prop "location"
   -- Type: TInterface (Name {namespace = "Gio", name = "File"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@location@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #location
-- @
getRepositoryLocation :: (MonadIO m, IsRepository o) => o -> m (Maybe Gio.File.File)
getRepositoryLocation obj = liftIO $ B.Properties.getObjectPropertyObject obj "location" Gio.File.File

-- | Construct a `GValueConstruct` with valid value for the “@location@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepositoryLocation :: (IsRepository o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructRepositoryLocation val = B.Properties.constructObjectPropertyObject "location" (Just val)

#if defined(ENABLE_OVERLOADING)
data RepositoryLocationPropertyInfo
instance AttrInfo RepositoryLocationPropertyInfo where
    type AttrAllowedOps RepositoryLocationPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepositoryLocationPropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryLocationPropertyInfo = Gio.File.IsFile
    type AttrTransferTypeConstraint RepositoryLocationPropertyInfo = Gio.File.IsFile
    type AttrTransferType RepositoryLocationPropertyInfo = Gio.File.File
    type AttrGetType RepositoryLocationPropertyInfo = (Maybe Gio.File.File)
    type AttrLabel RepositoryLocationPropertyInfo = "location"
    type AttrOrigin RepositoryLocationPropertyInfo = Repository
    attrGet = getRepositoryLocation
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Gio.File.File v
    attrConstruct = constructRepositoryLocation
    attrClear = undefined
#endif

-- VVV Prop "url"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@url@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #url
-- @
getRepositoryUrl :: (MonadIO m, IsRepository o) => o -> m (Maybe T.Text)
getRepositoryUrl obj = liftIO $ B.Properties.getObjectPropertyString obj "url"

-- | Construct a `GValueConstruct` with valid value for the “@url@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepositoryUrl :: (IsRepository o) => T.Text -> IO (GValueConstruct o)
constructRepositoryUrl val = B.Properties.constructObjectPropertyString "url" (Just val)

#if defined(ENABLE_OVERLOADING)
data RepositoryUrlPropertyInfo
instance AttrInfo RepositoryUrlPropertyInfo where
    type AttrAllowedOps RepositoryUrlPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepositoryUrlPropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryUrlPropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint RepositoryUrlPropertyInfo = (~) T.Text
    type AttrTransferType RepositoryUrlPropertyInfo = T.Text
    type AttrGetType RepositoryUrlPropertyInfo = (Maybe T.Text)
    type AttrLabel RepositoryUrlPropertyInfo = "url"
    type AttrOrigin RepositoryUrlPropertyInfo = Repository
    attrGet = getRepositoryUrl
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructRepositoryUrl
    attrClear = undefined
#endif

-- VVV Prop "workdir"
   -- Type: TInterface (Name {namespace = "Gio", name = "File"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@workdir@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repository #workdir
-- @
getRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m (Maybe Gio.File.File)
getRepositoryWorkdir obj = liftIO $ B.Properties.getObjectPropertyObject obj "workdir" Gio.File.File

-- | Set the value of the “@workdir@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' repository [ #workdir 'Data.GI.Base.Attributes.:=' value ]
-- @
setRepositoryWorkdir :: (MonadIO m, IsRepository o, Gio.File.IsFile a) => o -> a -> m ()
setRepositoryWorkdir obj val = liftIO $ B.Properties.setObjectPropertyObject obj "workdir" (Just val)

-- | Construct a `GValueConstruct` with valid value for the “@workdir@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepositoryWorkdir :: (IsRepository o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructRepositoryWorkdir val = B.Properties.constructObjectPropertyObject "workdir" (Just val)

-- | Set the value of the “@workdir@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #workdir
-- @
clearRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m ()
clearRepositoryWorkdir obj = liftIO $ B.Properties.setObjectPropertyObject obj "workdir" (Nothing :: Maybe Gio.File.File)

#if defined(ENABLE_OVERLOADING)
data RepositoryWorkdirPropertyInfo
instance AttrInfo RepositoryWorkdirPropertyInfo where
    type AttrAllowedOps RepositoryWorkdirPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepositoryWorkdirPropertyInfo = IsRepository
    type AttrSetTypeConstraint RepositoryWorkdirPropertyInfo = Gio.File.IsFile
    type AttrTransferTypeConstraint RepositoryWorkdirPropertyInfo = Gio.File.IsFile
    type AttrTransferType RepositoryWorkdirPropertyInfo = Gio.File.File
    type AttrGetType RepositoryWorkdirPropertyInfo = (Maybe Gio.File.File)
    type AttrLabel RepositoryWorkdirPropertyInfo = "workdir"
    type AttrOrigin RepositoryWorkdirPropertyInfo = Repository
    attrGet = getRepositoryWorkdir
    attrSet = setRepositoryWorkdir
    attrTransfer _ v = do
        unsafeCastTo Gio.File.File v
    attrConstruct = constructRepositoryWorkdir
    attrClear = clearRepositoryWorkdir
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Repository
type instance O.AttributeList Repository = RepositoryAttributeList
type RepositoryAttributeList = ('[ '("cloneOptions", RepositoryCloneOptionsPropertyInfo), '("head", RepositoryHeadPropertyInfo), '("init", RepositoryInitPropertyInfo), '("isBare", RepositoryIsBarePropertyInfo), '("location", RepositoryLocationPropertyInfo), '("native", Ggit.Native.NativeNativePropertyInfo), '("url", RepositoryUrlPropertyInfo), '("workdir", RepositoryWorkdirPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
repositoryCloneOptions :: AttrLabelProxy "cloneOptions"
repositoryCloneOptions = AttrLabelProxy

repositoryHead :: AttrLabelProxy "head"
repositoryHead = AttrLabelProxy

repositoryInit :: AttrLabelProxy "init"
repositoryInit = AttrLabelProxy

repositoryLocation :: AttrLabelProxy "location"
repositoryLocation = AttrLabelProxy

repositoryUrl :: AttrLabelProxy "url"
repositoryUrl = AttrLabelProxy

repositoryWorkdir :: AttrLabelProxy "workdir"
repositoryWorkdir = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Repository = RepositorySignalList
type RepositorySignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method Repository::add_remote_fetch
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Remote" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRemote." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refspec"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the fetch refspec." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_add_remote_fetch" ggit_repository_add_remote_fetch ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Remote.Remote ->               -- remote : TInterface (Name {namespace = "Ggit", name = "Remote"})
    CString ->                              -- refspec : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Adds a fetch refspec to the /@remote@/\'s configuration.
-- Adds /@refspec@/ to the fetch list in the configuration. No
-- loaded remote instances will be affected.
repositoryAddRemoteFetch ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Remote.IsRemote b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@remote@/: a t'GI.Ggit.Objects.Remote.Remote'.
    -> T.Text
    -- ^ /@refspec@/: the fetch refspec.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryAddRemoteFetch repository remote refspec = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    remote' <- unsafeManagedPtrCastPtr remote
    refspec' <- textToCString refspec
    onException (do
        propagateGError $ ggit_repository_add_remote_fetch repository' remote' refspec'
        touchManagedPtr repository
        touchManagedPtr remote
        freeMem refspec'
        return ()
     ) (do
        freeMem refspec'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryAddRemoteFetchMethodInfo
instance (signature ~ (b -> T.Text -> m ()), MonadIO m, IsRepository a, Ggit.Remote.IsRemote b) => O.MethodInfo RepositoryAddRemoteFetchMethodInfo a signature where
    overloadedMethod = repositoryAddRemoteFetch

#endif

-- method Repository::add_remote_push
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Remote" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRemote." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refspec"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the push refspec." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_add_remote_push" ggit_repository_add_remote_push ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Remote.Remote ->               -- remote : TInterface (Name {namespace = "Ggit", name = "Remote"})
    CString ->                              -- refspec : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Adds a push refspec to /@remote@/\'s configuration.
-- Adds the given refspec to the push list in the configuration. No
-- loaded remote instances will be affected.
repositoryAddRemotePush ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Remote.IsRemote b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@remote@/: a t'GI.Ggit.Objects.Remote.Remote'.
    -> T.Text
    -- ^ /@refspec@/: the push refspec.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryAddRemotePush repository remote refspec = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    remote' <- unsafeManagedPtrCastPtr remote
    refspec' <- textToCString refspec
    onException (do
        propagateGError $ ggit_repository_add_remote_push repository' remote' refspec'
        touchManagedPtr repository
        touchManagedPtr remote
        freeMem refspec'
        return ()
     ) (do
        freeMem refspec'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryAddRemotePushMethodInfo
instance (signature ~ (b -> T.Text -> m ()), MonadIO m, IsRepository a, Ggit.Remote.IsRemote b) => O.MethodInfo RepositoryAddRemotePushMethodInfo a signature where
    overloadedMethod = repositoryAddRemotePush

#endif

-- method Repository::blame_file
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the file to blame." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "blame_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "BlameOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "blame options." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Blame" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_blame_file" ggit_repository_blame_file ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Ggit.BlameOptions.BlameOptions ->   -- blame_options : TInterface (Name {namespace = "Ggit", name = "BlameOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Blame.Blame)

-- | Get a blame for a single file.
repositoryBlameFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Gio.File.IsFile b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@file@/: the file to blame.
    -> Maybe (Ggit.BlameOptions.BlameOptions)
    -- ^ /@blameOptions@/: blame options.
    -> m (Maybe Ggit.Blame.Blame)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Blame.Blame'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryBlameFile repository file blameOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    file' <- unsafeManagedPtrCastPtr file
    maybeBlameOptions <- case blameOptions of
        Nothing -> return nullPtr
        Just jBlameOptions -> do
            jBlameOptions' <- unsafeManagedPtrGetPtr jBlameOptions
            return jBlameOptions'
    onException (do
        result <- propagateGError $ ggit_repository_blame_file repository' file' maybeBlameOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Blame.Blame) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr file
        whenJust blameOptions touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryBlameFileMethodInfo
instance (signature ~ (b -> Maybe (Ggit.BlameOptions.BlameOptions) -> m (Maybe Ggit.Blame.Blame)), MonadIO m, IsRepository a, Gio.File.IsFile b) => O.MethodInfo RepositoryBlameFileMethodInfo a signature where
    overloadedMethod = repositoryBlameFile

#endif

-- method Repository::checkout_head
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CheckoutOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCheckoutOptions or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_checkout_head" ggit_repository_checkout_head ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Update files in the working tree to reflect the contents of current HEAD. If
-- /@options@/ is 'P.Nothing', then the default checkout options will be used.
-- 
-- If the checkout was not successfull, then /@error@/ will be set.
repositoryCheckoutHead ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.CheckoutOptions.IsCheckoutOptions b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@options@/: a t'GI.Ggit.Objects.CheckoutOptions.CheckoutOptions' or 'P.Nothing'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCheckoutHead repository options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrCastPtr jOptions
            return jOptions'
    onException (do
        _ <- propagateGError $ ggit_repository_checkout_head repository' maybeOptions
        touchManagedPtr repository
        whenJust options touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCheckoutHeadMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepository a, Ggit.CheckoutOptions.IsCheckoutOptions b) => O.MethodInfo RepositoryCheckoutHeadMethodInfo a signature where
    overloadedMethod = repositoryCheckoutHead

#endif

-- method Repository::checkout_index
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Index" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitIndex or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CheckoutOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCheckoutOptions or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_checkout_index" ggit_repository_checkout_index ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Index.Index ->                 -- index : TInterface (Name {namespace = "Ggit", name = "Index"})
    Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Update files in the working tree to reflect the contents of the index. If
-- /@index@/ is 'P.Nothing', then the current index of the repository will be used. If
-- /@options@/ is 'P.Nothing', then the default checkout options will be used.
-- 
-- If the checkout was not successfull, then /@error@/ will be set.
repositoryCheckoutIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Index.IsIndex b, Ggit.CheckoutOptions.IsCheckoutOptions c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@index@/: a t'GI.Ggit.Objects.Index.Index' or 'P.Nothing'.
    -> Maybe (c)
    -- ^ /@options@/: a t'GI.Ggit.Objects.CheckoutOptions.CheckoutOptions' or 'P.Nothing'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCheckoutIndex repository index options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeIndex <- case index of
        Nothing -> return nullPtr
        Just jIndex -> do
            jIndex' <- unsafeManagedPtrCastPtr jIndex
            return jIndex'
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrCastPtr jOptions
            return jOptions'
    onException (do
        _ <- propagateGError $ ggit_repository_checkout_index repository' maybeIndex maybeOptions
        touchManagedPtr repository
        whenJust index touchManagedPtr
        whenJust options touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCheckoutIndexMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepository a, Ggit.Index.IsIndex b, Ggit.CheckoutOptions.IsCheckoutOptions c) => O.MethodInfo RepositoryCheckoutIndexMethodInfo a signature where
    overloadedMethod = repositoryCheckoutIndex

#endif

-- method Repository::checkout_tree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tree"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitObject or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CheckoutOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCheckoutOptions or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_checkout_tree" ggit_repository_checkout_tree ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Object.Object ->               -- tree : TInterface (Name {namespace = "Ggit", name = "Object"})
    Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Update files in the working tree to reflect the contents of the specified
-- commit, tag or tree object. If /@tree@/ is 'P.Nothing', then the current HEAD of the
-- repository will be used. If /@options@/ is 'P.Nothing', then the default checkout
-- options will be used.
-- 
-- If the checkout was not successfull, then /@error@/ will be set.
repositoryCheckoutTree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.CheckoutOptions.IsCheckoutOptions c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@tree@/: a t'GI.Ggit.Objects.Object.Object' or 'P.Nothing'.
    -> Maybe (c)
    -- ^ /@options@/: a t'GI.Ggit.Objects.CheckoutOptions.CheckoutOptions' or 'P.Nothing'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCheckoutTree repository tree options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeTree <- case tree of
        Nothing -> return nullPtr
        Just jTree -> do
            jTree' <- unsafeManagedPtrCastPtr jTree
            return jTree'
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrCastPtr jOptions
            return jOptions'
    onException (do
        _ <- propagateGError $ ggit_repository_checkout_tree repository' maybeTree maybeOptions
        touchManagedPtr repository
        whenJust tree touchManagedPtr
        whenJust options touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCheckoutTreeMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.CheckoutOptions.IsCheckoutOptions c) => O.MethodInfo RepositoryCheckoutTreeMethodInfo a signature where
    overloadedMethod = repositoryCheckoutTree

#endif

-- method Repository::cherry_pick
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Commit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCommit." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CherryPickOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCherryPickOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_cherry_pick" ggit_repository_cherry_pick ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Commit.Commit ->               -- commit : TInterface (Name {namespace = "Ggit", name = "Commit"})
    Ptr Ggit.CherryPickOptions.CherryPickOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "CherryPickOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Cherry pick the specified commit, making changes in the index and the working
-- directory.
repositoryCherryPick ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Commit.IsCommit b, Ggit.CherryPickOptions.IsCherryPickOptions c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@commit@/: a t'GI.Ggit.Objects.Commit.Commit'.
    -> c
    -- ^ /@options@/: a t'GI.Ggit.Objects.CherryPickOptions.CherryPickOptions'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCherryPick repository commit options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    commit' <- unsafeManagedPtrCastPtr commit
    options' <- unsafeManagedPtrCastPtr options
    onException (do
        _ <- propagateGError $ ggit_repository_cherry_pick repository' commit' options'
        touchManagedPtr repository
        touchManagedPtr commit
        touchManagedPtr options
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCherryPickMethodInfo
instance (signature ~ (b -> c -> m ()), MonadIO m, IsRepository a, Ggit.Commit.IsCommit b, Ggit.CherryPickOptions.IsCherryPickOptions c) => O.MethodInfo RepositoryCherryPickMethodInfo a signature where
    overloadedMethod = repositoryCherryPick

#endif

-- method Repository::cherry_pick_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Commit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCommit to cherry-pick."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "our_commit"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Commit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCommit to cherry-pick on."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mainline"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the parent of the commit, in case of a merge commit."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "merge_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "MergeOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitMergeOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Index" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_cherry_pick_commit" ggit_repository_cherry_pick_commit ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Commit.Commit ->               -- commit : TInterface (Name {namespace = "Ggit", name = "Commit"})
    Ptr Ggit.Commit.Commit ->               -- our_commit : TInterface (Name {namespace = "Ggit", name = "Commit"})
    Word32 ->                               -- mainline : TBasicType TUInt
    Ptr Ggit.MergeOptions.MergeOptions ->   -- merge_options : TInterface (Name {namespace = "Ggit", name = "MergeOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Index.Index)

-- | Cherry-picks the given /@commit@/ against the provided /@ourCommit@/, producing
-- and index that reflects the result of the cherry-pick.
repositoryCherryPickCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Commit.IsCommit b, Ggit.Commit.IsCommit c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@commit@/: a t'GI.Ggit.Objects.Commit.Commit' to cherry-pick.
    -> c
    -- ^ /@ourCommit@/: a t'GI.Ggit.Objects.Commit.Commit' to cherry-pick on.
    -> Word32
    -- ^ /@mainline@/: the parent of the commit, in case of a merge commit.
    -> Maybe (Ggit.MergeOptions.MergeOptions)
    -- ^ /@mergeOptions@/: a t'GI.Ggit.Structs.MergeOptions.MergeOptions'.
    -> m (Maybe Ggit.Index.Index)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Index.Index'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCherryPickCommit repository commit ourCommit mainline mergeOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    commit' <- unsafeManagedPtrCastPtr commit
    ourCommit' <- unsafeManagedPtrCastPtr ourCommit
    maybeMergeOptions <- case mergeOptions of
        Nothing -> return nullPtr
        Just jMergeOptions -> do
            jMergeOptions' <- unsafeManagedPtrGetPtr jMergeOptions
            return jMergeOptions'
    onException (do
        result <- propagateGError $ ggit_repository_cherry_pick_commit repository' commit' ourCommit' mainline maybeMergeOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Index.Index) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr commit
        touchManagedPtr ourCommit
        whenJust mergeOptions touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCherryPickCommitMethodInfo
instance (signature ~ (b -> c -> Word32 -> Maybe (Ggit.MergeOptions.MergeOptions) -> m (Maybe Ggit.Index.Index)), MonadIO m, IsRepository a, Ggit.Commit.IsCommit b, Ggit.Commit.IsCommit c) => O.MethodInfo RepositoryCherryPickCommitMethodInfo a signature where
    overloadedMethod = repositoryCherryPickCommit

#endif

-- method Repository::create_blob
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Ggit" , name = "BlobOutputStream" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_repository_create_blob" ggit_repository_create_blob ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    IO (Ptr Ggit.BlobOutputStream.BlobOutputStream)

-- | Create a new blob and return a t'GI.Gio.Objects.OutputStream.OutputStream' to write contents to the blob.
-- This is an efficient way to create new blobs without copying data. The
-- blob id can be obtained from the blob output stream using
-- @/ggit_blob_output_stream_get_id/@, after you close the stream.
repositoryCreateBlob ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Ggit.BlobOutputStream.BlobOutputStream)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.BlobOutputStream.BlobOutputStream'.
repositoryCreateBlob repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    result <- ggit_repository_create_blob repository'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Ggit.BlobOutputStream.BlobOutputStream) result'
        return result''
    touchManagedPtr repository
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateBlobMethodInfo
instance (signature ~ (m (Maybe Ggit.BlobOutputStream.BlobOutputStream)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateBlobMethodInfo a signature where
    overloadedMethod = repositoryCreateBlob

#endif

-- method Repository::create_blob_from_buffer
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the data." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the length (in bytes) of the data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "size"
--              , argType = TBasicType TUInt64
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the length (in bytes) of the data."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_blob_from_buffer" ggit_repository_create_blob_from_buffer ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Word8 ->                            -- buffer : TCArray False (-1) 2 (TBasicType TUInt8)
    Word64 ->                               -- size : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Write an in-memory buffer to the object database as a blob.
repositoryCreateBlobFromBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> ByteString
    -- ^ /@buffer@/: the data.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the new @/GgitOid/@ of the written blob,
    -- or 'P.Nothing' if writing the blob failed. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateBlobFromBuffer repository buffer = liftIO $ do
    let size = fromIntegral $ B.length buffer
    repository' <- unsafeManagedPtrCastPtr repository
    buffer' <- packByteString buffer
    onException (do
        result <- propagateGError $ ggit_repository_create_blob_from_buffer repository' buffer' size
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        freeMem buffer'
        return maybeResult
     ) (do
        freeMem buffer'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateBlobFromBufferMethodInfo
instance (signature ~ (ByteString -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateBlobFromBufferMethodInfo a signature where
    overloadedMethod = repositoryCreateBlobFromBuffer

#endif

-- method Repository::create_blob_from_file
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GFile." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_blob_from_file" ggit_repository_create_blob_from_file ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Write a file to the object database as a blob.
-- 
-- Returns (transfer full) (nullable): the new @/GgitOid/@ of the written blob,
-- or 'P.Nothing' if writing the blob failed.
repositoryCreateBlobFromFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Gio.File.IsFile b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@file@/: a t'GI.Gio.Interfaces.File.File'.
    -> m Ggit.OId.OId
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateBlobFromFile repository file = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    file' <- unsafeManagedPtrCastPtr file
    onException (do
        result <- propagateGError $ ggit_repository_create_blob_from_file repository' file'
        checkUnexpectedReturnNULL "repositoryCreateBlobFromFile" result
        result' <- (wrapBoxed Ggit.OId.OId) result
        touchManagedPtr repository
        touchManagedPtr file
        return result'
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateBlobFromFileMethodInfo
instance (signature ~ (b -> m Ggit.OId.OId), MonadIO m, IsRepository a, Gio.File.IsFile b) => O.MethodInfo RepositoryCreateBlobFromFileMethodInfo a signature where
    overloadedMethod = repositoryCreateBlobFromFile

#endif

-- method Repository::create_blob_from_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the file path." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_blob_from_path" ggit_repository_create_blob_from_path ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- path : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Write a path relative to the repository working directory to the object
-- database as a blob.
repositoryCreateBlobFromPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@path@/: the file path.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the new @/GgitOid/@ of the written blob,
    -- or 'P.Nothing' if writing the blob failed. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateBlobFromPath repository path = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    path' <- textToCString path
    onException (do
        result <- propagateGError $ ggit_repository_create_blob_from_path repository' path'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        freeMem path'
        return maybeResult
     ) (do
        freeMem path'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateBlobFromPathMethodInfo
instance (signature ~ (T.Text -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateBlobFromPathMethodInfo a signature where
    overloadedMethod = repositoryCreateBlobFromPath

#endif

-- method Repository::create_branch
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "branch_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the branch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitObject." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CreateFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCreateFlags."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Branch" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_branch" ggit_repository_create_branch ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- branch_name : TBasicType TUTF8
    Ptr Ggit.Object.Object ->               -- target : TInterface (Name {namespace = "Ggit", name = "Object"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Ggit", name = "CreateFlags"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Branch.Branch)

-- | Creates a new branch pointing at a target commit.
repositoryCreateBranch ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@branchName@/: the name of the branch.
    -> b
    -- ^ /@target@/: a t'GI.Ggit.Objects.Object.Object'.
    -> [Ggit.Flags.CreateFlags]
    -- ^ /@flags@/: a t'GI.Ggit.Flags.CreateFlags'.
    -> m (Maybe Ggit.Branch.Branch)
    -- ^ __Returns:__ the reference to which the branch
    --                                        points, or 'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateBranch repository branchName target flags = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    branchName' <- textToCString branchName
    target' <- unsafeManagedPtrCastPtr target
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ ggit_repository_create_branch repository' branchName' target' flags'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Branch.Branch) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr target
        freeMem branchName'
        return maybeResult
     ) (do
        freeMem branchName'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateBranchMethodInfo
instance (signature ~ (T.Text -> b -> [Ggit.Flags.CreateFlags] -> m (Maybe Ggit.Branch.Branch)), MonadIO m, IsRepository a, Ggit.Object.IsObject b) => O.MethodInfo RepositoryCreateBranchMethodInfo a signature where
    overloadedMethod = repositoryCreateBranch

#endif

-- method Repository::create_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "update_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of the reference to update."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "author"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "author signature." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "committer"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "committer signature (and time of commit)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message_encoding"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "message encoding." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "commit message." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tree of objects to commit."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parents"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 8
--                 (TInterface Name { namespace = "Ggit" , name = "Commit" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "parent commits." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_count"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "number of parent commits in @parents."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "parent_count"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "number of parent commits in @parents."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_commit" ggit_repository_create_commit ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- update_ref : TBasicType TUTF8
    Ptr Ggit.Signature.Signature ->         -- author : TInterface (Name {namespace = "Ggit", name = "Signature"})
    Ptr Ggit.Signature.Signature ->         -- committer : TInterface (Name {namespace = "Ggit", name = "Signature"})
    CString ->                              -- message_encoding : TBasicType TUTF8
    CString ->                              -- message : TBasicType TUTF8
    Ptr Ggit.Tree.Tree ->                   -- tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr (Ptr Ggit.Commit.Commit) ->         -- parents : TCArray False (-1) 8 (TInterface (Name {namespace = "Ggit", name = "Commit"}))
    Int32 ->                                -- parent_count : TBasicType TInt
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Create a new commit. If /@updateRef@/ is not 'P.Nothing', the given reference will
-- be updated to point to the newly created commit. Use \"HEAD\" to update the
-- HEAD of the current branch and make it point to this commit.
-- 
-- If /@messageEncoding@/ is set to 'P.Nothing', \"UTF-8\" encoding is assumed for the
-- provided /@message@/. Note that /@message@/ will not be cleaned up automatically.
-- You can use @/ggit_message_prettify/@ to do this yourself if needed.
repositoryCreateCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c, Ggit.Tree.IsTree d) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@updateRef@/: name of the reference to update.
    -> b
    -- ^ /@author@/: author signature.
    -> c
    -- ^ /@committer@/: committer signature (and time of commit).
    -> Maybe (T.Text)
    -- ^ /@messageEncoding@/: message encoding.
    -> T.Text
    -- ^ /@message@/: commit message.
    -> d
    -- ^ /@tree@/: the tree of objects to commit.
    -> [Ggit.Commit.Commit]
    -- ^ /@parents@/: parent commits.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the t'GI.Ggit.Structs.OId.OId' of the created commit object,
    -- or 'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateCommit repository updateRef author committer messageEncoding message tree parents = liftIO $ do
    let parentCount = fromIntegral $ length parents
    repository' <- unsafeManagedPtrCastPtr repository
    maybeUpdateRef <- case updateRef of
        Nothing -> return nullPtr
        Just jUpdateRef -> do
            jUpdateRef' <- textToCString jUpdateRef
            return jUpdateRef'
    author' <- unsafeManagedPtrCastPtr author
    committer' <- unsafeManagedPtrCastPtr committer
    maybeMessageEncoding <- case messageEncoding of
        Nothing -> return nullPtr
        Just jMessageEncoding -> do
            jMessageEncoding' <- textToCString jMessageEncoding
            return jMessageEncoding'
    message' <- textToCString message
    tree' <- unsafeManagedPtrCastPtr tree
    parents' <- mapM unsafeManagedPtrCastPtr parents
    parents'' <- packPtrArray parents'
    onException (do
        result <- propagateGError $ ggit_repository_create_commit repository' maybeUpdateRef author' committer' maybeMessageEncoding message' tree' parents'' parentCount
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr author
        touchManagedPtr committer
        touchManagedPtr tree
        mapM_ touchManagedPtr parents
        freeMem maybeUpdateRef
        freeMem maybeMessageEncoding
        freeMem message'
        freeMem parents''
        return maybeResult
     ) (do
        freeMem maybeUpdateRef
        freeMem maybeMessageEncoding
        freeMem message'
        freeMem parents''
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateCommitMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> c -> Maybe (T.Text) -> T.Text -> d -> [Ggit.Commit.Commit] -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c, Ggit.Tree.IsTree d) => O.MethodInfo RepositoryCreateCommitMethodInfo a signature where
    overloadedMethod = repositoryCreateCommit

#endif

-- method Repository::create_commit_from_ids
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "update_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of the reference to update."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "author"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "author signature." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "committer"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "committer signature (and time of commit)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message_encoding"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "message encoding." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "commit message." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tree of objects to commit."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parents"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 8
--                 (TInterface Name { namespace = "Ggit" , name = "OId" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "parent commits." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_count"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "number of parent commits in @parents."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "parent_count"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "number of parent commits in @parents."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_commit_from_ids" ggit_repository_create_commit_from_ids ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- update_ref : TBasicType TUTF8
    Ptr Ggit.Signature.Signature ->         -- author : TInterface (Name {namespace = "Ggit", name = "Signature"})
    Ptr Ggit.Signature.Signature ->         -- committer : TInterface (Name {namespace = "Ggit", name = "Signature"})
    CString ->                              -- message_encoding : TBasicType TUTF8
    CString ->                              -- message : TBasicType TUTF8
    Ptr Ggit.OId.OId ->                     -- tree : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr Ggit.OId.OId) ->               -- parents : TCArray False (-1) 8 (TInterface (Name {namespace = "Ggit", name = "OId"}))
    Int32 ->                                -- parent_count : TBasicType TInt
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Create a new commit. If /@updateRef@/ is not 'P.Nothing', the given reference will
-- be updated to point to the newly created commit. Use \"HEAD\" to update the
-- HEAD of the current branch and make it point to this commit.
-- 
-- If /@messageEncoding@/ is set to 'P.Nothing', \"UTF-8\" encoding is assumed for the
-- provided /@message@/. Note that /@message@/ will not be cleaned up automatically.
-- You can use @/ggit_message_prettify/@ to do this yourself if needed.
repositoryCreateCommitFromIds ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@updateRef@/: name of the reference to update.
    -> b
    -- ^ /@author@/: author signature.
    -> c
    -- ^ /@committer@/: committer signature (and time of commit).
    -> Maybe (T.Text)
    -- ^ /@messageEncoding@/: message encoding.
    -> T.Text
    -- ^ /@message@/: commit message.
    -> Ggit.OId.OId
    -- ^ /@tree@/: the tree of objects to commit.
    -> [Ggit.OId.OId]
    -- ^ /@parents@/: parent commits.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the t'GI.Ggit.Structs.OId.OId' of the created commit object,
    -- or 'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateCommitFromIds repository updateRef author committer messageEncoding message tree parents = liftIO $ do
    let parentCount = fromIntegral $ length parents
    repository' <- unsafeManagedPtrCastPtr repository
    maybeUpdateRef <- case updateRef of
        Nothing -> return nullPtr
        Just jUpdateRef -> do
            jUpdateRef' <- textToCString jUpdateRef
            return jUpdateRef'
    author' <- unsafeManagedPtrCastPtr author
    committer' <- unsafeManagedPtrCastPtr committer
    maybeMessageEncoding <- case messageEncoding of
        Nothing -> return nullPtr
        Just jMessageEncoding -> do
            jMessageEncoding' <- textToCString jMessageEncoding
            return jMessageEncoding'
    message' <- textToCString message
    tree' <- unsafeManagedPtrGetPtr tree
    parents' <- mapM unsafeManagedPtrGetPtr parents
    parents'' <- packPtrArray parents'
    onException (do
        result <- propagateGError $ ggit_repository_create_commit_from_ids repository' maybeUpdateRef author' committer' maybeMessageEncoding message' tree' parents'' parentCount
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr author
        touchManagedPtr committer
        touchManagedPtr tree
        mapM_ touchManagedPtr parents
        freeMem maybeUpdateRef
        freeMem maybeMessageEncoding
        freeMem message'
        freeMem parents''
        return maybeResult
     ) (do
        freeMem maybeUpdateRef
        freeMem maybeMessageEncoding
        freeMem message'
        freeMem parents''
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateCommitFromIdsMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> c -> Maybe (T.Text) -> T.Text -> Ggit.OId.OId -> [Ggit.OId.OId] -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c) => O.MethodInfo RepositoryCreateCommitFromIdsMethodInfo a signature where
    overloadedMethod = repositoryCreateCommitFromIds

#endif

-- method Repository::create_index_entry_for_file
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GFile." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "IndexEntry" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_index_entry_for_file" ggit_repository_create_index_entry_for_file ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Ggit.OId.OId ->                     -- id : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.IndexEntry.IndexEntry)

-- | Create a new index entry. When /@file@/ is not 'P.Nothing', the path of the returned
-- entry (@/ggit_index_entry_get_path/@) is set to the path of /@file@/ relative to
-- the working directory of /@repository@/. The file must reside in the working
-- directory of /@repository@/. The file related
-- fields of the returned entry are also queried from this file (if the file exists).
-- 
-- If /@id@/ is not 'P.Nothing', then the id of the returned entry is set to /@id@/
-- (see @/ggit_index_entry_get_id/@) which could point to a blob (for a file)
-- or a tree (for a directory).
repositoryCreateIndexEntryForFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Gio.File.IsFile b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@file@/: a t'GI.Gio.Interfaces.File.File'.
    -> Maybe (Ggit.OId.OId)
    -- ^ /@id@/: a t'GI.Ggit.Structs.OId.OId'.
    -> m (Maybe Ggit.IndexEntry.IndexEntry)
    -- ^ __Returns:__ a t'GI.Ggit.Structs.IndexEntry.IndexEntry' or 'P.Nothing' when an error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateIndexEntryForFile repository file id = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeFile <- case file of
        Nothing -> return nullPtr
        Just jFile -> do
            jFile' <- unsafeManagedPtrCastPtr jFile
            return jFile'
    maybeId <- case id of
        Nothing -> return nullPtr
        Just jId -> do
            jId' <- unsafeManagedPtrGetPtr jId
            return jId'
    onException (do
        result <- propagateGError $ ggit_repository_create_index_entry_for_file repository' maybeFile maybeId
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.IndexEntry.IndexEntry) result'
            return result''
        touchManagedPtr repository
        whenJust file touchManagedPtr
        whenJust id touchManagedPtr
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateIndexEntryForFileMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Ggit.OId.OId) -> m (Maybe Ggit.IndexEntry.IndexEntry)), MonadIO m, IsRepository a, Gio.File.IsFile b) => O.MethodInfo RepositoryCreateIndexEntryForFileMethodInfo a signature where
    overloadedMethod = repositoryCreateIndexEntryForFile

#endif

-- method Repository::create_index_entry_for_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a path." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "IndexEntry" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_index_entry_for_path" ggit_repository_create_index_entry_for_path ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- path : TBasicType TUTF8
    Ptr Ggit.OId.OId ->                     -- id : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.IndexEntry.IndexEntry)

-- | Create a new index entry. When /@path@/ is not 'P.Nothing', the path of the returned
-- entry (@/ggit_index_entry_get_path/@) is set to /@path@/. The specified path can be
-- either absolute or relative. In the case of
-- an absolute path, the path must reside within the working directory of
-- /@repository@/. The file related fields of the returned entry are also queried
-- from this path (if the file exists).
-- 
-- If /@id@/ is not 'P.Nothing', then the id of the returned entry is set to /@id@/
-- (see @/ggit_index_entry_get_id/@) which could point to a blob (for a file)
-- or a tree (for a directory).
repositoryCreateIndexEntryForPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@path@/: a path.
    -> Maybe (Ggit.OId.OId)
    -- ^ /@id@/: a t'GI.Ggit.Structs.OId.OId'.
    -> m (Maybe Ggit.IndexEntry.IndexEntry)
    -- ^ __Returns:__ a t'GI.Ggit.Structs.IndexEntry.IndexEntry' or 'P.Nothing' when an error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateIndexEntryForPath repository path id = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybePath <- case path of
        Nothing -> return nullPtr
        Just jPath -> do
            jPath' <- textToCString jPath
            return jPath'
    maybeId <- case id of
        Nothing -> return nullPtr
        Just jId -> do
            jId' <- unsafeManagedPtrGetPtr jId
            return jId'
    onException (do
        result <- propagateGError $ ggit_repository_create_index_entry_for_path repository' maybePath maybeId
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.IndexEntry.IndexEntry) result'
            return result''
        touchManagedPtr repository
        whenJust id touchManagedPtr
        freeMem maybePath
        return maybeResult
     ) (do
        freeMem maybePath
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateIndexEntryForPathMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (Ggit.OId.OId) -> m (Maybe Ggit.IndexEntry.IndexEntry)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateIndexEntryForPathMethodInfo a signature where
    overloadedMethod = repositoryCreateIndexEntryForPath

#endif

-- method Repository::create_note
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "notes_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "canonical name of the reference to use, or %NULL to use the default ref."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "author"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "author signature." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "committer"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "committer signature."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OID of the git object to decorate."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "note"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "content of the note to add for object oid."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "force"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "whether to overwrite existing note."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_note" ggit_repository_create_note ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- notes_ref : TBasicType TUTF8
    Ptr Ggit.Signature.Signature ->         -- author : TInterface (Name {namespace = "Ggit", name = "Signature"})
    Ptr Ggit.Signature.Signature ->         -- committer : TInterface (Name {namespace = "Ggit", name = "Signature"})
    Ptr Ggit.OId.OId ->                     -- id : TInterface (Name {namespace = "Ggit", name = "OId"})
    CString ->                              -- note : TBasicType TUTF8
    CInt ->                                 -- force : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Adds a note for an object.
repositoryCreateNote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@notesRef@/: canonical name of the reference to use, or 'P.Nothing' to use the default ref.
    -> b
    -- ^ /@author@/: author signature.
    -> c
    -- ^ /@committer@/: committer signature.
    -> Ggit.OId.OId
    -- ^ /@id@/: OID of the git object to decorate.
    -> T.Text
    -- ^ /@note@/: content of the note to add for object oid.
    -> Bool
    -- ^ /@force@/: whether to overwrite existing note.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the OID for the note or 'P.Nothing' in case of error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateNote repository notesRef author committer id note force = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeNotesRef <- case notesRef of
        Nothing -> return nullPtr
        Just jNotesRef -> do
            jNotesRef' <- textToCString jNotesRef
            return jNotesRef'
    author' <- unsafeManagedPtrCastPtr author
    committer' <- unsafeManagedPtrCastPtr committer
    id' <- unsafeManagedPtrGetPtr id
    note' <- textToCString note
    let force' = (fromIntegral . fromEnum) force
    onException (do
        result <- propagateGError $ ggit_repository_create_note repository' maybeNotesRef author' committer' id' note' force'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr author
        touchManagedPtr committer
        touchManagedPtr id
        freeMem maybeNotesRef
        freeMem note'
        return maybeResult
     ) (do
        freeMem maybeNotesRef
        freeMem note'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateNoteMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> c -> Ggit.OId.OId -> T.Text -> Bool -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c) => O.MethodInfo RepositoryCreateNoteMethodInfo a signature where
    overloadedMethod = repositoryCreateNote

#endif

-- method Repository::create_reference
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name for the new #GgitRef."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GgitOId pointed to by the reference."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "log_message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The one line long message to be appended to the reflog."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Ref" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_reference" ggit_repository_create_reference ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr Ggit.OId.OId ->                     -- oid : TInterface (Name {namespace = "Ggit", name = "OId"})
    CString ->                              -- log_message : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Ref.Ref)

-- | Creates a new object id reference.
-- 
-- The reference will be created in the repository and written
-- to the disk. The returned value must be freed with 'GI.GObject.Objects.Object.objectUnref'.
repositoryCreateReference ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name for the new t'GI.Ggit.Objects.Ref.Ref'.
    -> Ggit.OId.OId
    -- ^ /@oid@/: the t'GI.Ggit.Structs.OId.OId' pointed to by the reference.
    -> T.Text
    -- ^ /@logMessage@/: The one line long message to be appended to the reflog.
    -> m (Maybe Ggit.Ref.Ref)
    -- ^ __Returns:__ the newly created reference. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateReference repository name oid logMessage = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    oid' <- unsafeManagedPtrGetPtr oid
    logMessage' <- textToCString logMessage
    onException (do
        result <- propagateGError $ ggit_repository_create_reference repository' name' oid' logMessage'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Ref.Ref) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oid
        freeMem name'
        freeMem logMessage'
        return maybeResult
     ) (do
        freeMem name'
        freeMem logMessage'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateReferenceMethodInfo
instance (signature ~ (T.Text -> Ggit.OId.OId -> T.Text -> m (Maybe Ggit.Ref.Ref)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateReferenceMethodInfo a signature where
    overloadedMethod = repositoryCreateReference

#endif

-- method Repository::create_remote
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the new remote."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "url"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the url of the remote."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Remote" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_remote" ggit_repository_create_remote ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- url : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Remote.Remote)

-- | Adds a remote with the default fetch refspec to the repository\'s configuration.
repositoryCreateRemote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the new remote.
    -> T.Text
    -- ^ /@url@/: the url of the remote.
    -> m (Maybe Ggit.Remote.Remote)
    -- ^ __Returns:__ a new t'GI.Ggit.Objects.Remote.Remote' or 'P.Nothing' if there is an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateRemote repository name url = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    url' <- textToCString url
    onException (do
        result <- propagateGError $ ggit_repository_create_remote repository' name' url'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Remote.Remote) result'
            return result''
        touchManagedPtr repository
        freeMem name'
        freeMem url'
        return maybeResult
     ) (do
        freeMem name'
        freeMem url'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateRemoteMethodInfo
instance (signature ~ (T.Text -> T.Text -> m (Maybe Ggit.Remote.Remote)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateRemoteMethodInfo a signature where
    overloadedMethod = repositoryCreateRemote

#endif

-- method Repository::create_symbolic_reference
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name for the new #GgitRef."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the full name to the reference."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "log_message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The one line long message to be appended to the reflog."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Ref" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_symbolic_reference" ggit_repository_create_symbolic_reference ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- target : TBasicType TUTF8
    CString ->                              -- log_message : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Ref.Ref)

-- | Creates a new symbolic reference.
-- 
-- The reference will be created in the repository and written
-- to the disk. The returned value must be freed with 'GI.GObject.Objects.Object.objectUnref'.
repositoryCreateSymbolicReference ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name for the new t'GI.Ggit.Objects.Ref.Ref'.
    -> T.Text
    -- ^ /@target@/: the full name to the reference.
    -> T.Text
    -- ^ /@logMessage@/: The one line long message to be appended to the reflog.
    -> m (Maybe Ggit.Ref.Ref)
    -- ^ __Returns:__ the newly created reference. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateSymbolicReference repository name target logMessage = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    target' <- textToCString target
    logMessage' <- textToCString logMessage
    onException (do
        result <- propagateGError $ ggit_repository_create_symbolic_reference repository' name' target' logMessage'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Ref.Ref) result'
            return result''
        touchManagedPtr repository
        freeMem name'
        freeMem target'
        freeMem logMessage'
        return maybeResult
     ) (do
        freeMem name'
        freeMem target'
        freeMem logMessage'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateSymbolicReferenceMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> m (Maybe Ggit.Ref.Ref)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateSymbolicReferenceMethodInfo a signature where
    overloadedMethod = repositoryCreateSymbolicReference

#endif

-- method Repository::create_tag
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tag_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tag name." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitObject." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tagger"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitSignature." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tag message." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CreateFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCreateFlags."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_tag" ggit_repository_create_tag ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- tag_name : TBasicType TUTF8
    Ptr Ggit.Object.Object ->               -- target : TInterface (Name {namespace = "Ggit", name = "Object"})
    Ptr Ggit.Signature.Signature ->         -- tagger : TInterface (Name {namespace = "Ggit", name = "Signature"})
    CString ->                              -- message : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Ggit", name = "CreateFlags"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Create a new tag object.
repositoryCreateTag ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.Signature.IsSignature c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@tagName@/: the tag name.
    -> b
    -- ^ /@target@/: a t'GI.Ggit.Objects.Object.Object'.
    -> c
    -- ^ /@tagger@/: a t'GI.Ggit.Objects.Signature.Signature'.
    -> T.Text
    -- ^ /@message@/: the tag message.
    -> [Ggit.Flags.CreateFlags]
    -- ^ /@flags@/: a t'GI.Ggit.Flags.CreateFlags'.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the id to which the tag points, or
    --                                        'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateTag repository tagName target tagger message flags = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    tagName' <- textToCString tagName
    target' <- unsafeManagedPtrCastPtr target
    tagger' <- unsafeManagedPtrCastPtr tagger
    message' <- textToCString message
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ ggit_repository_create_tag repository' tagName' target' tagger' message' flags'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr target
        touchManagedPtr tagger
        freeMem tagName'
        freeMem message'
        return maybeResult
     ) (do
        freeMem tagName'
        freeMem message'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateTagMethodInfo
instance (signature ~ (T.Text -> b -> c -> T.Text -> [Ggit.Flags.CreateFlags] -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.Signature.IsSignature c) => O.MethodInfo RepositoryCreateTagMethodInfo a signature where
    overloadedMethod = repositoryCreateTag

#endif

-- method Repository::create_tag_annotation
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tag_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the tag."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitObject." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitObject." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tag message." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_tag_annotation" ggit_repository_create_tag_annotation ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- tag_name : TBasicType TUTF8
    Ptr Ggit.Object.Object ->               -- target : TInterface (Name {namespace = "Ggit", name = "Object"})
    Ptr Ggit.Signature.Signature ->         -- signature : TInterface (Name {namespace = "Ggit", name = "Signature"})
    CString ->                              -- message : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Creates a new annotated tag.
repositoryCreateTagAnnotation ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.Signature.IsSignature c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@tagName@/: the name of the tag.
    -> b
    -- ^ /@target@/: a t'GI.Ggit.Objects.Object.Object'.
    -> c
    -- ^ /@signature@/: a t'GI.Ggit.Objects.Object.Object'.
    -> T.Text
    -- ^ /@message@/: the tag message.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the id to which the tag points, or
    --                                        'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateTagAnnotation repository tagName target signature message = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    tagName' <- textToCString tagName
    target' <- unsafeManagedPtrCastPtr target
    signature' <- unsafeManagedPtrCastPtr signature
    message' <- textToCString message
    onException (do
        result <- propagateGError $ ggit_repository_create_tag_annotation repository' tagName' target' signature' message'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr target
        touchManagedPtr signature
        freeMem tagName'
        freeMem message'
        return maybeResult
     ) (do
        freeMem tagName'
        freeMem message'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateTagAnnotationMethodInfo
instance (signature ~ (T.Text -> b -> c -> T.Text -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.Signature.IsSignature c) => O.MethodInfo RepositoryCreateTagAnnotationMethodInfo a signature where
    overloadedMethod = repositoryCreateTagAnnotation

#endif

-- method Repository::create_tag_from_buffer
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tag"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tag buffer." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CreateFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCreateFlags."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_tag_from_buffer" ggit_repository_create_tag_from_buffer ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- tag : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Ggit", name = "CreateFlags"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Create a new tag from a buffer describing the tag object. The buffer must
-- be correctly formatted.
repositoryCreateTagFromBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@tag@/: the tag buffer.
    -> [Ggit.Flags.CreateFlags]
    -- ^ /@flags@/: a t'GI.Ggit.Flags.CreateFlags'.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the id to which the tag points, or
    --                                        'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateTagFromBuffer repository tag flags = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    tag' <- textToCString tag
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ ggit_repository_create_tag_from_buffer repository' tag' flags'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        freeMem tag'
        return maybeResult
     ) (do
        freeMem tag'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateTagFromBufferMethodInfo
instance (signature ~ (T.Text -> [Ggit.Flags.CreateFlags] -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateTagFromBufferMethodInfo a signature where
    overloadedMethod = repositoryCreateTagFromBuffer

#endif

-- method Repository::create_tag_lightweight
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tag_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the tag."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitObject." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CreateFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCreateFlags."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_tag_lightweight" ggit_repository_create_tag_lightweight ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- tag_name : TBasicType TUTF8
    Ptr Ggit.Object.Object ->               -- target : TInterface (Name {namespace = "Ggit", name = "Object"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Ggit", name = "CreateFlags"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Creates a new lightweight tag.
repositoryCreateTagLightweight ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@tagName@/: the name of the tag.
    -> b
    -- ^ /@target@/: a t'GI.Ggit.Objects.Object.Object'.
    -> [Ggit.Flags.CreateFlags]
    -- ^ /@flags@/: a t'GI.Ggit.Flags.CreateFlags'.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the id to which the tag points, or
    --                                        'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateTagLightweight repository tagName target flags = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    tagName' <- textToCString tagName
    target' <- unsafeManagedPtrCastPtr target
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ ggit_repository_create_tag_lightweight repository' tagName' target' flags'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr target
        freeMem tagName'
        return maybeResult
     ) (do
        freeMem tagName'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateTagLightweightMethodInfo
instance (signature ~ (T.Text -> b -> [Ggit.Flags.CreateFlags] -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Object.IsObject b) => O.MethodInfo RepositoryCreateTagLightweightMethodInfo a signature where
    overloadedMethod = repositoryCreateTagLightweight

#endif

-- method Repository::create_tree_builder
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Ggit" , name = "TreeBuilder" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_tree_builder" ggit_repository_create_tree_builder ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.TreeBuilder.TreeBuilder)

-- | Create a new tree builder.
repositoryCreateTreeBuilder ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Ggit.TreeBuilder.TreeBuilder)
    -- ^ __Returns:__ a new t'GI.Ggit.Objects.TreeBuilder.TreeBuilder',
    -- or 'P.Nothing' if there was an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateTreeBuilder repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_create_tree_builder repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.TreeBuilder.TreeBuilder) result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateTreeBuilderMethodInfo
instance (signature ~ (m (Maybe Ggit.TreeBuilder.TreeBuilder)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryCreateTreeBuilderMethodInfo a signature where
    overloadedMethod = repositoryCreateTreeBuilder

#endif

-- method Repository::create_tree_builder_from_tree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitTree." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Ggit" , name = "TreeBuilder" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_create_tree_builder_from_tree" ggit_repository_create_tree_builder_from_tree ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Tree.Tree ->                   -- tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.TreeBuilder.TreeBuilder)

-- | Create a tree builder for initialized with /@tree@/. To create an empty
-- tree builder, use @/ggit_repository_create_tree_builder/@ instead.
repositoryCreateTreeBuilderFromTree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Tree.IsTree b) =>
    a
    -> b
    -- ^ /@tree@/: a t'GI.Ggit.Objects.Tree.Tree'.
    -> m (Maybe Ggit.TreeBuilder.TreeBuilder)
    -- ^ __Returns:__ a new t'GI.Ggit.Objects.TreeBuilder.TreeBuilder' object,
    -- or 'P.Nothing' if there was an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryCreateTreeBuilderFromTree repository tree = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    tree' <- unsafeManagedPtrCastPtr tree
    onException (do
        result <- propagateGError $ ggit_repository_create_tree_builder_from_tree repository' tree'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.TreeBuilder.TreeBuilder) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr tree
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryCreateTreeBuilderFromTreeMethodInfo
instance (signature ~ (b -> m (Maybe Ggit.TreeBuilder.TreeBuilder)), MonadIO m, IsRepository a, Ggit.Tree.IsTree b) => O.MethodInfo RepositoryCreateTreeBuilderFromTreeMethodInfo a signature where
    overloadedMethod = repositoryCreateTreeBuilderFromTree

#endif

-- method Repository::delete_tag
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the tag."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_delete_tag" ggit_repository_delete_tag ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Delete an existing tag reference by name.
repositoryDeleteTag ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the tag.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryDeleteTag repository name = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    onException (do
        _ <- propagateGError $ ggit_repository_delete_tag repository' name'
        touchManagedPtr repository
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryDeleteTagMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryDeleteTagMethodInfo a signature where
    overloadedMethod = repositoryDeleteTag

#endif

-- method Repository::drop_stash
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the position within the stash list. 0 points to the.\nmost recent stashed state."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_drop_stash" ggit_repository_drop_stash ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Word64 ->                               -- index : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Removes a single stashed state from the stash list.
repositoryDropStash ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Word64
    -- ^ /@index@/: the position within the stash list. 0 points to the.
    -- most recent stashed state.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryDropStash repository index = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        propagateGError $ ggit_repository_drop_stash repository' index
        touchManagedPtr repository
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryDropStashMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryDropStashMethodInfo a signature where
    overloadedMethod = repositoryDropStash

#endif

-- method Repository::enumerate_branches
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "list_type"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "BranchType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitBranchType." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Ggit" , name = "BranchEnumerator" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_enumerate_branches" ggit_repository_enumerate_branches ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CUInt ->                                -- list_type : TInterface (Name {namespace = "Ggit", name = "BranchType"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.BranchEnumerator.BranchEnumerator)

-- | Get a branch enumerator to enumerate over all branches of the specified
-- /@listType@/ in /@repository@/.
repositoryEnumerateBranches ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.Enums.BranchType
    -- ^ /@listType@/: a t'GI.Ggit.Enums.BranchType'.
    -> m (Maybe Ggit.BranchEnumerator.BranchEnumerator)
    -- ^ __Returns:__ a branch enumerator. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryEnumerateBranches repository listType = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    let listType' = (fromIntegral . fromEnum) listType
    onException (do
        result <- propagateGError $ ggit_repository_enumerate_branches repository' listType'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.BranchEnumerator.BranchEnumerator) result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryEnumerateBranchesMethodInfo
instance (signature ~ (Ggit.Enums.BranchType -> m (Maybe Ggit.BranchEnumerator.BranchEnumerator)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryEnumerateBranchesMethodInfo a signature where
    overloadedMethod = repositoryEnumerateBranches

#endif

-- method Repository::file_status
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "location"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the file to retrieve status for, rooted at the repository working dir."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Ggit" , name = "StatusFlags" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_file_status" ggit_repository_file_status ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Gio.File.File ->                    -- location : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO CUInt

-- | Gets the file status for a single file.
repositoryFileStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Gio.File.IsFile b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@location@/: the file to retrieve status for, rooted at the repository working dir.
    -> m [Ggit.Flags.StatusFlags]
    -- ^ __Returns:__ the status for a single file. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryFileStatus repository location = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    location' <- unsafeManagedPtrCastPtr location
    onException (do
        result <- propagateGError $ ggit_repository_file_status repository' location'
        let result' = wordToGFlags result
        touchManagedPtr repository
        touchManagedPtr location
        return result'
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryFileStatusMethodInfo
instance (signature ~ (b -> m [Ggit.Flags.StatusFlags]), MonadIO m, IsRepository a, Gio.File.IsFile b) => O.MethodInfo RepositoryFileStatusMethodInfo a signature where
    overloadedMethod = repositoryFileStatus

#endif

-- method Repository::file_status_foreach
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "StatusOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "status options, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "StatusCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitStatusCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_file_status_foreach" ggit_repository_file_status_foreach ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.StatusOptions.StatusOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "StatusOptions"})
    FunPtr Ggit.Callbacks.C_StatusCallback -> -- callback : TInterface (Name {namespace = "Ggit", name = "StatusCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Gathers file statuses and run a callback for each one.
-- 
-- To the callback is passed the path of the file, the status and the data pointer
-- passed to this function. If the callback returns something other than
-- 0, the iteration will stop and /@error@/ will be set.
-- 
-- Set /@options@/ to 'P.Nothing' to get the default status options.
repositoryFileStatusForeach ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (Ggit.StatusOptions.StatusOptions)
    -- ^ /@options@/: status options, or 'P.Nothing'.
    -> Ggit.Callbacks.StatusCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.StatusCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryFileStatusForeach repository options callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrGetPtr jOptions
            return jOptions'
    callback' <- Ggit.Callbacks.mk_StatusCallback (Ggit.Callbacks.wrap_StatusCallback Nothing (Ggit.Callbacks.drop_closures_StatusCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_file_status_foreach repository' maybeOptions callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        whenJust options touchManagedPtr
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryFileStatusForeachMethodInfo
instance (signature ~ (Maybe (Ggit.StatusOptions.StatusOptions) -> Ggit.Callbacks.StatusCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryFileStatusForeachMethodInfo a signature where
    overloadedMethod = repositoryFileStatusForeach

#endif

-- method Repository::get_ahead_behind
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "local"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the commit for local."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "upstream"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the commit for upstream."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ahead"
--           , argType = TBasicType TUInt64
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "number of unique from commits in @upstream."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "behind"
--           , argType = TBasicType TUInt64
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "number of unique from commits in @local."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_ahead_behind" ggit_repository_get_ahead_behind ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- local : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr Ggit.OId.OId ->                     -- upstream : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr Word64 ->                           -- ahead : TBasicType TUInt64
    Ptr Word64 ->                           -- behind : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Count the number of unique commits between two commit objects.
-- 
-- There is no need for branches containing the commits to have any
-- upstream relationship, but it helps to think of one as a branch and
-- the other as its upstream, the /@ahead@/ and /@behind@/ values will be
-- what git would report for the branches.
repositoryGetAheadBehind ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@local@/: the commit for local.
    -> Ggit.OId.OId
    -- ^ /@upstream@/: the commit for upstream.
    -> m ((Word64, Word64))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetAheadBehind repository local upstream = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    local' <- unsafeManagedPtrGetPtr local
    upstream' <- unsafeManagedPtrGetPtr upstream
    ahead <- allocMem :: IO (Ptr Word64)
    behind <- allocMem :: IO (Ptr Word64)
    onException (do
        propagateGError $ ggit_repository_get_ahead_behind repository' local' upstream' ahead behind
        ahead' <- peek ahead
        behind' <- peek behind
        touchManagedPtr repository
        touchManagedPtr local
        touchManagedPtr upstream
        freeMem ahead
        freeMem behind
        return (ahead', behind')
     ) (do
        freeMem ahead
        freeMem behind
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetAheadBehindMethodInfo
instance (signature ~ (Ggit.OId.OId -> Ggit.OId.OId -> m ((Word64, Word64))), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetAheadBehindMethodInfo a signature where
    overloadedMethod = repositoryGetAheadBehind

#endif

-- method Repository::get_attribute
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the relative path to the file."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the attribute."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "Ggit" , name = "AttributeCheckFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitAttributeCheckFlags."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_attribute" ggit_repository_get_attribute ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- path : TBasicType TUTF8
    CString ->                              -- name : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Ggit", name = "AttributeCheckFlags"})
    Ptr (Ptr GError) ->                     -- error
    IO CString

-- | Get the attribute value of the specified attribute for the given file.
repositoryGetAttribute ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@path@/: the relative path to the file.
    -> T.Text
    -- ^ /@name@/: the name of the attribute.
    -> [Ggit.Flags.AttributeCheckFlags]
    -- ^ /@flags@/: a t'GI.Ggit.Flags.AttributeCheckFlags'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the attribute value, or 'P.Nothing'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetAttribute repository path name flags = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    path' <- textToCString path
    name' <- textToCString name
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ ggit_repository_get_attribute repository' path' name' flags'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- cstringToText result'
            return result''
        touchManagedPtr repository
        freeMem path'
        freeMem name'
        return maybeResult
     ) (do
        freeMem path'
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetAttributeMethodInfo
instance (signature ~ (T.Text -> T.Text -> [Ggit.Flags.AttributeCheckFlags] -> m (Maybe T.Text)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetAttributeMethodInfo a signature where
    overloadedMethod = repositoryGetAttribute

#endif

-- method Repository::get_config
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Config" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_config" ggit_repository_get_config ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Config.Config)

-- | Get the config for a specific repository.
repositoryGetConfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Ggit.Config.Config)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Config.Config'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetConfig repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_get_config repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Config.Config) result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetConfigMethodInfo
instance (signature ~ (m (Maybe Ggit.Config.Config)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetConfigMethodInfo a signature where
    overloadedMethod = repositoryGetConfig

#endif

-- method Repository::get_default_notes_ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_default_notes_ref" ggit_repository_get_default_notes_ref ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO CString

-- | Gets the default notes reference for /@repository@/. It defaults to
-- \"refs\/notes\/commits\".
repositoryGetDefaultNotesRef ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the default notes reference for /@repository@/. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetDefaultNotesRef repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_get_default_notes_ref repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- cstringToText result'
            freeMem result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetDefaultNotesRefMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetDefaultNotesRefMethodInfo a signature where
    overloadedMethod = repositoryGetDefaultNotesRef

#endif

-- method Repository::get_descendant_of
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the commit." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ancestor"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the ancestor." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_descendant_of" ggit_repository_get_descendant_of ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- commit : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr Ggit.OId.OId ->                     -- ancestor : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Check whether /@com@/ mit is a descendant of /@ancestor@/. Note that if this
-- function returns 'P.False', an error might have occurred. If so, /@error@/ will
-- be set appropriately.
repositoryGetDescendantOf ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@commit@/: the commit.
    -> Ggit.OId.OId
    -- ^ /@ancestor@/: the ancestor.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetDescendantOf repository commit ancestor = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    commit' <- unsafeManagedPtrGetPtr commit
    ancestor' <- unsafeManagedPtrGetPtr ancestor
    onException (do
        _ <- propagateGError $ ggit_repository_get_descendant_of repository' commit' ancestor'
        touchManagedPtr repository
        touchManagedPtr commit
        touchManagedPtr ancestor
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetDescendantOfMethodInfo
instance (signature ~ (Ggit.OId.OId -> Ggit.OId.OId -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetDescendantOfMethodInfo a signature where
    overloadedMethod = repositoryGetDescendantOf

#endif

-- method Repository::get_head
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Ref" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_head" ggit_repository_get_head ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Ref.Ref)

-- | Get and resolves the current HEAD reference of the repository. Note that the
-- returned ref is already resolved (if HEAD is symbolic). If you want to
-- retrieve the symbolic ref called HEAD, then use @/ggit_repository_lookup_reference/@
-- instead.
repositoryGetHead ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Ggit.Ref.Ref)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Ref.Ref' /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetHead repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_get_head repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Ref.Ref) result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetHeadMethodInfo
instance (signature ~ (m (Maybe Ggit.Ref.Ref)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetHeadMethodInfo a signature where
    overloadedMethod = repositoryGetHead

#endif

-- method Repository::get_index
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Index" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_index" ggit_repository_get_index ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Index.Index)

-- | Get the index for a specific repository.
repositoryGetIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Ggit.Index.Index)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Index.Index'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetIndex repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_get_index repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Index.Index) result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetIndexMethodInfo
instance (signature ~ (m (Maybe Ggit.Index.Index)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetIndexMethodInfo a signature where
    overloadedMethod = repositoryGetIndex

#endif

-- method Repository::get_location
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "File" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_repository_get_location" ggit_repository_get_location ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    IO (Ptr Gio.File.File)

-- | Get the gitdir location of the repository.
repositoryGetLocation ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Gio.File.File)
    -- ^ __Returns:__ the location of the gitdir of the repository.
repositoryGetLocation repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    result <- ggit_repository_get_location repository'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Gio.File.File) result'
        return result''
    touchManagedPtr repository
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data RepositoryGetLocationMethodInfo
instance (signature ~ (m (Maybe Gio.File.File)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetLocationMethodInfo a signature where
    overloadedMethod = repositoryGetLocation

#endif

-- method Repository::get_submodule_status
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the submodule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ignore"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "SubmoduleIgnore" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the ignore rules to follow."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Ggit" , name = "SubmoduleStatus" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_get_submodule_status" ggit_repository_get_submodule_status ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CInt ->                                 -- ignore : TInterface (Name {namespace = "Ggit", name = "SubmoduleIgnore"})
    Ptr (Ptr GError) ->                     -- error
    IO CUInt

-- | Gets the status for a submodule.
-- This looks at a submodule and tries to determine the status.  It
-- will return a combination of the @/GGIT_SUBMODULE_STATUS/@ values.
-- How deeply it examines the working directory to do this will depend
-- on /@ignore@/.
repositoryGetSubmoduleStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the submodule.
    -> Ggit.Enums.SubmoduleIgnore
    -- ^ /@ignore@/: the ignore rules to follow.
    -> m [Ggit.Flags.SubmoduleStatus]
    -- ^ __Returns:__ the t'GI.Ggit.Flags.SubmoduleStatus' for /@submodule@/. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryGetSubmoduleStatus repository name ignore = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    let ignore' = (fromIntegral . fromEnum) ignore
    onException (do
        result <- propagateGError $ ggit_repository_get_submodule_status repository' name' ignore'
        let result' = wordToGFlags result
        touchManagedPtr repository
        freeMem name'
        return result'
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryGetSubmoduleStatusMethodInfo
instance (signature ~ (T.Text -> Ggit.Enums.SubmoduleIgnore -> m [Ggit.Flags.SubmoduleStatus]), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetSubmoduleStatusMethodInfo a signature where
    overloadedMethod = repositoryGetSubmoduleStatus

#endif

-- method Repository::get_workdir
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "File" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_repository_get_workdir" ggit_repository_get_workdir ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    IO (Ptr Gio.File.File)

-- | Gets the working directory of the repository.
repositoryGetWorkdir ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe Gio.File.File)
    -- ^ __Returns:__ the location of the working directory of the repository.
repositoryGetWorkdir repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    result <- ggit_repository_get_workdir repository'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Gio.File.File) result'
        return result''
    touchManagedPtr repository
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data RepositoryGetWorkdirMethodInfo
instance (signature ~ (m (Maybe Gio.File.File)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryGetWorkdirMethodInfo a signature where
    overloadedMethod = repositoryGetWorkdir

#endif

-- method Repository::is_bare
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "ggit_repository_is_bare" ggit_repository_is_bare ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    IO CInt

-- | Checks if /@repository@/ is bare.
repositoryIsBare ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the repository is empty.
repositoryIsBare repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    result <- ggit_repository_is_bare repository'
    let result' = (/= 0) result
    touchManagedPtr repository
    return result'

#if defined(ENABLE_OVERLOADING)
data RepositoryIsBareMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepository a) => O.MethodInfo RepositoryIsBareMethodInfo a signature where
    overloadedMethod = repositoryIsBare

#endif

-- method Repository::is_empty
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_is_empty" ggit_repository_is_empty ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Checks if /@repository@/ is empty.
-- 
-- An empty repository has just been initialized and contains
-- no commits.
repositoryIsEmpty ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryIsEmpty repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        _ <- propagateGError $ ggit_repository_is_empty repository'
        touchManagedPtr repository
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryIsEmptyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryIsEmptyMethodInfo a signature where
    overloadedMethod = repositoryIsEmpty

#endif

-- method Repository::is_head_detached
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_is_head_detached" ggit_repository_is_head_detached ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Checks if /@repository@/\'s HEAD is detached.
-- 
-- A repository\'s HEAD is detached when it points directly to a commit
-- instead of a branch.
repositoryIsHeadDetached ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryIsHeadDetached repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        _ <- propagateGError $ ggit_repository_is_head_detached repository'
        touchManagedPtr repository
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryIsHeadDetachedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryIsHeadDetachedMethodInfo a signature where
    overloadedMethod = repositoryIsHeadDetached

#endif

-- method Repository::is_head_unborn
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_is_head_unborn" ggit_repository_is_head_unborn ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Checks if /@repository@/\'s HEAD is an orphan.
-- 
-- An orphan branch is one named from HEAD but doesn\'t exist in
-- the refs namespace, because it doesn\'t have any commit to point to.
repositoryIsHeadUnborn ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryIsHeadUnborn repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        _ <- propagateGError $ ggit_repository_is_head_unborn repository'
        touchManagedPtr repository
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryIsHeadUnbornMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryIsHeadUnbornMethodInfo a signature where
    overloadedMethod = repositoryIsHeadUnborn

#endif

-- method Repository::list_remotes
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_list_remotes" ggit_repository_list_remotes ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr CString)

-- | Fill a list with all the remotes in /@repository@/.
repositoryListRemotes ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe [T.Text])
    -- ^ __Returns:__ a list with the remotes. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryListRemotes repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_list_remotes repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- unpackZeroTerminatedUTF8CArray result'
            mapZeroTerminatedCArray freeMem result'
            freeMem result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryListRemotesMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsRepository a) => O.MethodInfo RepositoryListRemotesMethodInfo a signature where
    overloadedMethod = repositoryListRemotes

#endif

-- method Repository::list_tags
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_list_tags" ggit_repository_list_tags ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr CString)

-- | Fill a list with all the tags in the /@repository@/.
repositoryListTags ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> m (Maybe [T.Text])
    -- ^ __Returns:__ a list with the tags in /@repository@/. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryListTags repository = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    onException (do
        result <- propagateGError $ ggit_repository_list_tags repository'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- unpackZeroTerminatedUTF8CArray result'
            mapZeroTerminatedCArray freeMem result'
            freeMem result'
            return result''
        touchManagedPtr repository
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryListTagsMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsRepository a) => O.MethodInfo RepositoryListTagsMethodInfo a signature where
    overloadedMethod = repositoryListTags

#endif

-- method Repository::list_tags_match
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "pattern"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a pattern to match."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_list_tags_match" ggit_repository_list_tags_match ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- pattern : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr CString)

-- | Fill a list with all the tags in the /@repository@/ matching the provided
-- pattern. The pattern can use standard fnmatch syntax.
repositoryListTagsMatch ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@pattern@/: a pattern to match.
    -> m (Maybe [T.Text])
    -- ^ __Returns:__ a list with matching tags in /@repository@/. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryListTagsMatch repository pattern = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybePattern <- case pattern of
        Nothing -> return nullPtr
        Just jPattern -> do
            jPattern' <- textToCString jPattern
            return jPattern'
    onException (do
        result <- propagateGError $ ggit_repository_list_tags_match repository' maybePattern
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- unpackZeroTerminatedUTF8CArray result'
            mapZeroTerminatedCArray freeMem result'
            freeMem result'
            return result''
        touchManagedPtr repository
        freeMem maybePattern
        return maybeResult
     ) (do
        freeMem maybePattern
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryListTagsMatchMethodInfo
instance (signature ~ (Maybe (T.Text) -> m (Maybe [T.Text])), MonadIO m, IsRepository a) => O.MethodInfo RepositoryListTagsMatchMethodInfo a signature where
    overloadedMethod = repositoryListTagsMatch

#endif

-- method Repository::lookup
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "gtype"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GType." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Object" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup" ggit_repository_lookup ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- oid : TInterface (Name {namespace = "Ggit", name = "OId"})
    CGType ->                               -- gtype : TBasicType TGType
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Object.Object)

-- | Lookups a reference to one of the objects in the /@repository@/.
-- 
-- The generated reference must be freed with 'GI.GObject.Objects.Object.objectUnref'.
-- 
-- The /@gtype@/ must match the type of the object
-- in the odb; the method will fail otherwise.
-- The special value @/G_TYPE_NONE/@ may be passed to let
-- the method guess the object\'s type.
repositoryLookup ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@oid@/: a t'GI.Ggit.Structs.OId.OId'.
    -> GType
    -- ^ /@gtype@/: a t'GType'.
    -> m (Maybe Ggit.Object.Object)
    -- ^ __Returns:__ the found t'GI.Ggit.Objects.Object.Object', or 'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookup repository oid gtype = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    oid' <- unsafeManagedPtrGetPtr oid
    let gtype' = gtypeToCGType gtype
    onException (do
        result <- propagateGError $ ggit_repository_lookup repository' oid' gtype'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Object.Object) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oid
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupMethodInfo
instance (signature ~ (Ggit.OId.OId -> GType -> m (Maybe Ggit.Object.Object)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupMethodInfo a signature where
    overloadedMethod = repositoryLookup

#endif

-- method Repository::lookup_blob
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Blob" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_blob" ggit_repository_lookup_blob ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- oid : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Blob.Blob)

-- | Lookups a branch by its name in a repository.
repositoryLookupBlob ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@oid@/: a t'GI.Ggit.Structs.OId.OId'.
    -> m (Maybe Ggit.Blob.Blob)
    -- ^ __Returns:__ a @/GgitBlog/@ pointer. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupBlob repository oid = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    oid' <- unsafeManagedPtrGetPtr oid
    onException (do
        result <- propagateGError $ ggit_repository_lookup_blob repository' oid'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Blob.Blob) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oid
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupBlobMethodInfo
instance (signature ~ (Ggit.OId.OId -> m (Maybe Ggit.Blob.Blob)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupBlobMethodInfo a signature where
    overloadedMethod = repositoryLookupBlob

#endif

-- method Repository::lookup_branch
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "branch_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the branch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "branch_type"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "BranchType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitBranchType." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Branch" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_branch" ggit_repository_lookup_branch ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- branch_name : TBasicType TUTF8
    CUInt ->                                -- branch_type : TInterface (Name {namespace = "Ggit", name = "BranchType"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Branch.Branch)

-- | Lookups a branch by its name in a repository.
repositoryLookupBranch ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@branchName@/: the name of the branch.
    -> Ggit.Enums.BranchType
    -- ^ /@branchType@/: a t'GI.Ggit.Enums.BranchType'.
    -> m (Maybe Ggit.Branch.Branch)
    -- ^ __Returns:__ a branch by its name in a repository. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupBranch repository branchName branchType = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    branchName' <- textToCString branchName
    let branchType' = (fromIntegral . fromEnum) branchType
    onException (do
        result <- propagateGError $ ggit_repository_lookup_branch repository' branchName' branchType'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Branch.Branch) result'
            return result''
        touchManagedPtr repository
        freeMem branchName'
        return maybeResult
     ) (do
        freeMem branchName'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupBranchMethodInfo
instance (signature ~ (T.Text -> Ggit.Enums.BranchType -> m (Maybe Ggit.Branch.Branch)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupBranchMethodInfo a signature where
    overloadedMethod = repositoryLookupBranch

#endif

-- method Repository::lookup_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Commit" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_commit" ggit_repository_lookup_commit ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- oid : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Commit.Commit)

-- | Lookups a branch by its name in a repository.
repositoryLookupCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@oid@/: a t'GI.Ggit.Structs.OId.OId'.
    -> m (Maybe Ggit.Commit.Commit)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Commit.Commit' pointer. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupCommit repository oid = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    oid' <- unsafeManagedPtrGetPtr oid
    onException (do
        result <- propagateGError $ ggit_repository_lookup_commit repository' oid'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Commit.Commit) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oid
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupCommitMethodInfo
instance (signature ~ (Ggit.OId.OId -> m (Maybe Ggit.Commit.Commit)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupCommitMethodInfo a signature where
    overloadedMethod = repositoryLookupCommit

#endif

-- method Repository::lookup_reference
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the long name for the reference (e.g. HEAD, ref/heads/master, refs/tags/v0.1.0, ...)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Ref" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_reference" ggit_repository_lookup_reference ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Ref.Ref)

-- | Lookups a reference by its name in /@repository@/. The returned t'GI.Ggit.Objects.Ref.Ref' must
-- be freed with 'GI.GObject.Objects.Object.objectUnref'.
repositoryLookupReference ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the long name for the reference (e.g. HEAD, ref\/heads\/master, refs\/tags\/v0.1.0, ...).
    -> m (Maybe Ggit.Ref.Ref)
    -- ^ __Returns:__ the searched reference. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupReference repository name = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    onException (do
        result <- propagateGError $ ggit_repository_lookup_reference repository' name'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Ref.Ref) result'
            return result''
        touchManagedPtr repository
        freeMem name'
        return maybeResult
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupReferenceMethodInfo
instance (signature ~ (T.Text -> m (Maybe Ggit.Ref.Ref)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupReferenceMethodInfo a signature where
    overloadedMethod = repositoryLookupReference

#endif

-- method Repository::lookup_reference_dwim
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "short_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the short name for the reference (e.g. master, v0.1.0, ...)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Ref" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_reference_dwim" ggit_repository_lookup_reference_dwim ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- short_name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Ref.Ref)

-- | Lookups a reference by its short name in /@repository@/ applying the git precendence
-- rules to the given shorthand to determine which reference the user is referring to.
-- The returned t'GI.Ggit.Objects.Ref.Ref' must be freed with 'GI.GObject.Objects.Object.objectUnref'.
repositoryLookupReferenceDwim ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@shortName@/: the short name for the reference (e.g. master, v0.1.0, ...).
    -> m (Maybe Ggit.Ref.Ref)
    -- ^ __Returns:__ the searched reference. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupReferenceDwim repository shortName = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    shortName' <- textToCString shortName
    onException (do
        result <- propagateGError $ ggit_repository_lookup_reference_dwim repository' shortName'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Ref.Ref) result'
            return result''
        touchManagedPtr repository
        freeMem shortName'
        return maybeResult
     ) (do
        freeMem shortName'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupReferenceDwimMethodInfo
instance (signature ~ (T.Text -> m (Maybe Ggit.Ref.Ref)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupReferenceDwimMethodInfo a signature where
    overloadedMethod = repositoryLookupReferenceDwim

#endif

-- method Repository::lookup_remote
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the remote's name." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Remote" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_remote" ggit_repository_lookup_remote ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Remote.Remote)

-- | Gets the remote called /@name@/.
repositoryLookupRemote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the remote\'s name.
    -> m (Maybe Ggit.Remote.Remote)
    -- ^ __Returns:__ a new t'GI.Ggit.Objects.Remote.Remote' or 'P.Nothing' if there is an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupRemote repository name = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    onException (do
        result <- propagateGError $ ggit_repository_lookup_remote repository' name'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Remote.Remote) result'
            return result''
        touchManagedPtr repository
        freeMem name'
        return maybeResult
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupRemoteMethodInfo
instance (signature ~ (T.Text -> m (Maybe Ggit.Remote.Remote)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupRemoteMethodInfo a signature where
    overloadedMethod = repositoryLookupRemote

#endif

-- method Repository::lookup_submodule
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the submodule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Submodule" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_submodule" ggit_repository_lookup_submodule ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Submodule.Submodule)

-- | Lookups a submodule information by name or path. If the submodule
-- does not exist, 'P.Nothing' is returned and a GGIT_ERROR_NOTFOUND error set.
repositoryLookupSubmodule ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the submodule.
    -> m (Maybe Ggit.Submodule.Submodule)
    -- ^ __Returns:__ a newly-allocated t'GI.Ggit.Structs.Submodule.Submodule'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupSubmodule repository name = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    onException (do
        result <- propagateGError $ ggit_repository_lookup_submodule repository' name'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.Submodule.Submodule) result'
            return result''
        touchManagedPtr repository
        freeMem name'
        return maybeResult
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupSubmoduleMethodInfo
instance (signature ~ (T.Text -> m (Maybe Ggit.Submodule.Submodule)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupSubmoduleMethodInfo a signature where
    overloadedMethod = repositoryLookupSubmodule

#endif

-- method Repository::lookup_tag
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Tag" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_tag" ggit_repository_lookup_tag ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- oid : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Tag.Tag)

-- | Lookups a branch by its name in a repository.
repositoryLookupTag ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@oid@/: a t'GI.Ggit.Structs.OId.OId'.
    -> m (Maybe Ggit.Tag.Tag)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Tag.Tag' pointer. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupTag repository oid = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    oid' <- unsafeManagedPtrGetPtr oid
    onException (do
        result <- propagateGError $ ggit_repository_lookup_tag repository' oid'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Tag.Tag) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oid
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupTagMethodInfo
instance (signature ~ (Ggit.OId.OId -> m (Maybe Ggit.Tag.Tag)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupTagMethodInfo a signature where
    overloadedMethod = repositoryLookupTag

#endif

-- method Repository::lookup_tree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitOId." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Tree" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_lookup_tree" ggit_repository_lookup_tree ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- oid : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Tree.Tree)

-- | Lookups a branch by its name in a repository.
repositoryLookupTree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@oid@/: a t'GI.Ggit.Structs.OId.OId'.
    -> m (Maybe Ggit.Tree.Tree)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Tree.Tree' pointer. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryLookupTree repository oid = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    oid' <- unsafeManagedPtrGetPtr oid
    onException (do
        result <- propagateGError $ ggit_repository_lookup_tree repository' oid'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Tree.Tree) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oid
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryLookupTreeMethodInfo
instance (signature ~ (Ggit.OId.OId -> m (Maybe Ggit.Tree.Tree)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryLookupTreeMethodInfo a signature where
    overloadedMethod = repositoryLookupTree

#endif

-- method Repository::merge
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "their_heads"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface Name { namespace = "Ggit" , name = "AnnotatedCommit" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the heads to merge into"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "their_heads_length"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the length of their_heads"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "merge_opts"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "MergeOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "merge options" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checkout_opts"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CheckoutOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "checkout options" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "their_heads_length"
--              , argType = TBasicType TUInt64
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the length of their_heads"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_merge" ggit_repository_merge ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr (Ptr Ggit.AnnotatedCommit.AnnotatedCommit) -> -- their_heads : TCArray False (-1) 2 (TInterface (Name {namespace = "Ggit", name = "AnnotatedCommit"}))
    Word64 ->                               -- their_heads_length : TBasicType TUInt64
    Ptr Ggit.MergeOptions.MergeOptions ->   -- merge_opts : TInterface (Name {namespace = "Ggit", name = "MergeOptions"})
    Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- checkout_opts : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Merges the given commit(s) into HEAD, writing the results into the working directory.
-- Any changes are staged for commit and any conflicts are written to the index.
-- 
-- Callers should inspect the repository\'s index after this completes, resolve any conflicts and prepare a commit.
repositoryMerge ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.CheckoutOptions.IsCheckoutOptions b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> [Ggit.AnnotatedCommit.AnnotatedCommit]
    -- ^ /@theirHeads@/: the heads to merge into
    -> Ggit.MergeOptions.MergeOptions
    -- ^ /@mergeOpts@/: merge options
    -> b
    -- ^ /@checkoutOpts@/: checkout options
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryMerge repository theirHeads mergeOpts checkoutOpts = liftIO $ do
    let theirHeadsLength = fromIntegral $ length theirHeads
    repository' <- unsafeManagedPtrCastPtr repository
    theirHeads' <- mapM unsafeManagedPtrGetPtr theirHeads
    theirHeads'' <- packPtrArray theirHeads'
    mergeOpts' <- unsafeManagedPtrGetPtr mergeOpts
    checkoutOpts' <- unsafeManagedPtrCastPtr checkoutOpts
    onException (do
        propagateGError $ ggit_repository_merge repository' theirHeads'' theirHeadsLength mergeOpts' checkoutOpts'
        touchManagedPtr repository
        mapM_ touchManagedPtr theirHeads
        touchManagedPtr mergeOpts
        touchManagedPtr checkoutOpts
        freeMem theirHeads''
        return ()
     ) (do
        freeMem theirHeads''
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryMergeMethodInfo
instance (signature ~ ([Ggit.AnnotatedCommit.AnnotatedCommit] -> Ggit.MergeOptions.MergeOptions -> b -> m ()), MonadIO m, IsRepository a, Ggit.CheckoutOptions.IsCheckoutOptions b) => O.MethodInfo RepositoryMergeMethodInfo a signature where
    overloadedMethod = repositoryMerge

#endif

-- method Repository::merge_base
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid_one"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the oid of one of the commits."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "oid_two"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the oid of the second of the commits"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_merge_base" ggit_repository_merge_base ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.OId.OId ->                     -- oid_one : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr Ggit.OId.OId ->                     -- oid_two : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Find the merge base between two commits
repositoryMergeBase ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.OId.OId
    -- ^ /@oidOne@/: the oid of one of the commits.
    -> Ggit.OId.OId
    -- ^ /@oidTwo@/: the oid of the second of the commits
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ a new t'GI.Ggit.Structs.OId.OId' or 'P.Nothing' if an error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryMergeBase repository oidOne oidTwo = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    oidOne' <- unsafeManagedPtrGetPtr oidOne
    oidTwo' <- unsafeManagedPtrGetPtr oidTwo
    onException (do
        result <- propagateGError $ ggit_repository_merge_base repository' oidOne' oidTwo'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr oidOne
        touchManagedPtr oidTwo
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryMergeBaseMethodInfo
instance (signature ~ (Ggit.OId.OId -> Ggit.OId.OId -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryMergeBaseMethodInfo a signature where
    overloadedMethod = repositoryMergeBase

#endif

-- method Repository::merge_commits
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "our_commit"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Commit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the commit that reflects the destination tree."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "their_commit"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Commit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the commit that reflects the source tree."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "merge_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "MergeOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the merge options." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Index" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_merge_commits" ggit_repository_merge_commits ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Commit.Commit ->               -- our_commit : TInterface (Name {namespace = "Ggit", name = "Commit"})
    Ptr Ggit.Commit.Commit ->               -- their_commit : TInterface (Name {namespace = "Ggit", name = "Commit"})
    Ptr Ggit.MergeOptions.MergeOptions ->   -- merge_options : TInterface (Name {namespace = "Ggit", name = "MergeOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Index.Index)

-- | Merge two commits creating a t'GI.Ggit.Objects.Index.Index' reflecting the result of the merge.
repositoryMergeCommits ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Commit.IsCommit b, Ggit.Commit.IsCommit c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@ourCommit@/: the commit that reflects the destination tree.
    -> c
    -- ^ /@theirCommit@/: the commit that reflects the source tree.
    -> Ggit.MergeOptions.MergeOptions
    -- ^ /@mergeOptions@/: the merge options.
    -> m (Maybe Ggit.Index.Index)
    -- ^ __Returns:__ a new t'GI.Ggit.Objects.Index.Index' or 'P.Nothing' if an error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryMergeCommits repository ourCommit theirCommit mergeOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    ourCommit' <- unsafeManagedPtrCastPtr ourCommit
    theirCommit' <- unsafeManagedPtrCastPtr theirCommit
    mergeOptions' <- unsafeManagedPtrGetPtr mergeOptions
    onException (do
        result <- propagateGError $ ggit_repository_merge_commits repository' ourCommit' theirCommit' mergeOptions'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Index.Index) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr ourCommit
        touchManagedPtr theirCommit
        touchManagedPtr mergeOptions
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryMergeCommitsMethodInfo
instance (signature ~ (b -> c -> Ggit.MergeOptions.MergeOptions -> m (Maybe Ggit.Index.Index)), MonadIO m, IsRepository a, Ggit.Commit.IsCommit b, Ggit.Commit.IsCommit c) => O.MethodInfo RepositoryMergeCommitsMethodInfo a signature where
    overloadedMethod = repositoryMergeCommits

#endif

-- method Repository::merge_trees
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ancestor_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the common ancestor between the trees, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "our_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tree that reflects the destination tree."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "their_tree"
--           , argType = TInterface Name { namespace = "Ggit" , name = "Tree" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the tree that reflects the source tree."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "merge_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "MergeOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the merge options." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Index" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_merge_trees" ggit_repository_merge_trees ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Tree.Tree ->                   -- ancestor_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.Tree.Tree ->                   -- our_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.Tree.Tree ->                   -- their_tree : TInterface (Name {namespace = "Ggit", name = "Tree"})
    Ptr Ggit.MergeOptions.MergeOptions ->   -- merge_options : TInterface (Name {namespace = "Ggit", name = "MergeOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Index.Index)

-- | Merge two trees creating a t'GI.Ggit.Objects.Index.Index' reflecting the result of the merge.
repositoryMergeTrees ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Tree.IsTree b, Ggit.Tree.IsTree c, Ggit.Tree.IsTree d) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@ancestorTree@/: the common ancestor between the trees, or 'P.Nothing'.
    -> c
    -- ^ /@ourTree@/: the tree that reflects the destination tree.
    -> d
    -- ^ /@theirTree@/: the tree that reflects the source tree.
    -> Ggit.MergeOptions.MergeOptions
    -- ^ /@mergeOptions@/: the merge options.
    -> m (Maybe Ggit.Index.Index)
    -- ^ __Returns:__ a new t'GI.Ggit.Objects.Index.Index' or 'P.Nothing' if an error occurred. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryMergeTrees repository ancestorTree ourTree theirTree mergeOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    ancestorTree' <- unsafeManagedPtrCastPtr ancestorTree
    ourTree' <- unsafeManagedPtrCastPtr ourTree
    theirTree' <- unsafeManagedPtrCastPtr theirTree
    mergeOptions' <- unsafeManagedPtrGetPtr mergeOptions
    onException (do
        result <- propagateGError $ ggit_repository_merge_trees repository' ancestorTree' ourTree' theirTree' mergeOptions'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Index.Index) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr ancestorTree
        touchManagedPtr ourTree
        touchManagedPtr theirTree
        touchManagedPtr mergeOptions
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryMergeTreesMethodInfo
instance (signature ~ (b -> c -> d -> Ggit.MergeOptions.MergeOptions -> m (Maybe Ggit.Index.Index)), MonadIO m, IsRepository a, Ggit.Tree.IsTree b, Ggit.Tree.IsTree c, Ggit.Tree.IsTree d) => O.MethodInfo RepositoryMergeTreesMethodInfo a signature where
    overloadedMethod = repositoryMergeTrees

#endif

-- method Repository::note_foreach
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "notes_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "canonical name of the reference to use, or %NULL to use the default ref."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "NoteCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitNoteCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_note_foreach" ggit_repository_note_foreach ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- notes_ref : TBasicType TUTF8
    FunPtr Ggit.Callbacks.C_NoteCallback -> -- callback : TInterface (Name {namespace = "Ggit", name = "NoteCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Loop over all the notes within a specified namespace
-- and issue a callback for each one.
-- If /@callback@/ returns a non-zero value, this will stop looping.
repositoryNoteForeach ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@notesRef@/: canonical name of the reference to use, or 'P.Nothing' to use the default ref.
    -> Ggit.Callbacks.NoteCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.NoteCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryNoteForeach repository notesRef callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeNotesRef <- case notesRef of
        Nothing -> return nullPtr
        Just jNotesRef -> do
            jNotesRef' <- textToCString jNotesRef
            return jNotesRef'
    callback' <- Ggit.Callbacks.mk_NoteCallback (Ggit.Callbacks.wrap_NoteCallback Nothing (Ggit.Callbacks.drop_closures_NoteCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_note_foreach repository' maybeNotesRef callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        freeMem maybeNotesRef
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        freeMem maybeNotesRef
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryNoteForeachMethodInfo
instance (signature ~ (Maybe (T.Text) -> Ggit.Callbacks.NoteCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryNoteForeachMethodInfo a signature where
    overloadedMethod = repositoryNoteForeach

#endif

-- method Repository::path_is_ignored
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A path within the repository."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_path_is_ignored" ggit_repository_path_is_ignored ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- path : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Tests if the ignore rules apply to the path provided.
-- 
-- This acts similar to filtering performed when calling \"git add .\"
-- on the command line.
repositoryPathIsIgnored ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: A t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@path@/: A path within the repository.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryPathIsIgnored repository path = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    path' <- textToCString path
    onException (do
        _ <- propagateGError $ ggit_repository_path_is_ignored repository' path'
        touchManagedPtr repository
        freeMem path'
        return ()
     ) (do
        freeMem path'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryPathIsIgnoredMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryPathIsIgnoredMethodInfo a signature where
    overloadedMethod = repositoryPathIsIgnored

#endif

-- method Repository::read_note
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "notes_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "canonical name of the reference to use, or %NULL to use the default ref."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OID of the git object to decorate."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Note" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_read_note" ggit_repository_read_note ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- notes_ref : TBasicType TUTF8
    Ptr Ggit.OId.OId ->                     -- id : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Note.Note)

-- | Reads the note for an object.
repositoryReadNote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@notesRef@/: canonical name of the reference to use, or 'P.Nothing' to use the default ref.
    -> Ggit.OId.OId
    -- ^ /@id@/: OID of the git object to decorate.
    -> m (Maybe Ggit.Note.Note)
    -- ^ __Returns:__ the read note or 'P.Nothing' in case of an error. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryReadNote repository notesRef id = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeNotesRef <- case notesRef of
        Nothing -> return nullPtr
        Just jNotesRef -> do
            jNotesRef' <- textToCString jNotesRef
            return jNotesRef'
    id' <- unsafeManagedPtrGetPtr id
    onException (do
        result <- propagateGError $ ggit_repository_read_note repository' maybeNotesRef id'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.Note.Note) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr id
        freeMem maybeNotesRef
        return maybeResult
     ) (do
        freeMem maybeNotesRef
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryReadNoteMethodInfo
instance (signature ~ (Maybe (T.Text) -> Ggit.OId.OId -> m (Maybe Ggit.Note.Note)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryReadNoteMethodInfo a signature where
    overloadedMethod = repositoryReadNote

#endif

-- method Repository::rebase_init
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "branch"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "AnnotatedCommit" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the terminal commit to rebase, or %NULL to rebase the\ncurrent branch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "upstream"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "AnnotatedCommit" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the commit to begin rebasing from, or %NULL to\nrebase all reachable commits."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "onto"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "AnnotatedCommit" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the branch to rebase onto, or %NULL to rebase onto\nthe given upstream."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #GgitRebaseOptions to specify how rebase is performed, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Rebase" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_rebase_init" ggit_repository_rebase_init ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.AnnotatedCommit.AnnotatedCommit -> -- branch : TInterface (Name {namespace = "Ggit", name = "AnnotatedCommit"})
    Ptr Ggit.AnnotatedCommit.AnnotatedCommit -> -- upstream : TInterface (Name {namespace = "Ggit", name = "AnnotatedCommit"})
    Ptr Ggit.AnnotatedCommit.AnnotatedCommit -> -- onto : TInterface (Name {namespace = "Ggit", name = "AnnotatedCommit"})
    Ptr Ggit.RebaseOptions.RebaseOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Rebase.Rebase)

-- | Initializes a rebase operation to rebase the changes in /@branch@/
-- relative to /@upstream@/ onto another branch. To begin the rebase
-- process, call @/git_rebase_next()/@. When you have finished with this
-- object, call 'GI.GObject.Objects.Object.objectUnref'.
repositoryRebaseInit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (Ggit.AnnotatedCommit.AnnotatedCommit)
    -- ^ /@branch@/: the terminal commit to rebase, or 'P.Nothing' to rebase the
    -- current branch.
    -> Maybe (Ggit.AnnotatedCommit.AnnotatedCommit)
    -- ^ /@upstream@/: the commit to begin rebasing from, or 'P.Nothing' to
    -- rebase all reachable commits.
    -> Maybe (Ggit.AnnotatedCommit.AnnotatedCommit)
    -- ^ /@onto@/: the branch to rebase onto, or 'P.Nothing' to rebase onto
    -- the given upstream.
    -> Ggit.RebaseOptions.RebaseOptions
    -- ^ /@options@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions' to specify how rebase is performed, or 'P.Nothing'.
    -> m (Maybe Ggit.Rebase.Rebase)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Rebase.Rebase'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRebaseInit repository branch upstream onto options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeBranch <- case branch of
        Nothing -> return nullPtr
        Just jBranch -> do
            jBranch' <- unsafeManagedPtrGetPtr jBranch
            return jBranch'
    maybeUpstream <- case upstream of
        Nothing -> return nullPtr
        Just jUpstream -> do
            jUpstream' <- unsafeManagedPtrGetPtr jUpstream
            return jUpstream'
    maybeOnto <- case onto of
        Nothing -> return nullPtr
        Just jOnto -> do
            jOnto' <- unsafeManagedPtrGetPtr jOnto
            return jOnto'
    options' <- unsafeManagedPtrGetPtr options
    onException (do
        result <- propagateGError $ ggit_repository_rebase_init repository' maybeBranch maybeUpstream maybeOnto options'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Rebase.Rebase) result'
            return result''
        touchManagedPtr repository
        whenJust branch touchManagedPtr
        whenJust upstream touchManagedPtr
        whenJust onto touchManagedPtr
        touchManagedPtr options
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRebaseInitMethodInfo
instance (signature ~ (Maybe (Ggit.AnnotatedCommit.AnnotatedCommit) -> Maybe (Ggit.AnnotatedCommit.AnnotatedCommit) -> Maybe (Ggit.AnnotatedCommit.AnnotatedCommit) -> Ggit.RebaseOptions.RebaseOptions -> m (Maybe Ggit.Rebase.Rebase)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryRebaseInitMethodInfo a signature where
    overloadedMethod = repositoryRebaseInit

#endif

-- method Repository::rebase_open
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #GgitRebaseOptions to specify how rebase is performed, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Rebase" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_rebase_open" ggit_repository_rebase_open ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.RebaseOptions.RebaseOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Rebase.Rebase)

-- | Opens an existing rebase that was previously started by either an
-- invocation of @/ggit_rebase_init()/@ or by another client.
repositoryRebaseOpen ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.RebaseOptions.RebaseOptions
    -- ^ /@options@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions' to specify how rebase is performed, or 'P.Nothing'.
    -> m (Maybe Ggit.Rebase.Rebase)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.Rebase.Rebase'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRebaseOpen repository options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    options' <- unsafeManagedPtrGetPtr options
    onException (do
        result <- propagateGError $ ggit_repository_rebase_open repository' options'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Rebase.Rebase) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr options
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRebaseOpenMethodInfo
instance (signature ~ (Ggit.RebaseOptions.RebaseOptions -> m (Maybe Ggit.Rebase.Rebase)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryRebaseOpenMethodInfo a signature where
    overloadedMethod = repositoryRebaseOpen

#endif

-- method Repository::references_foreach
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface
--                 Name { namespace = "Ggit" , name = "ReferencesCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitReferencesCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_references_foreach" ggit_repository_references_foreach ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    FunPtr Ggit.Callbacks.C_ReferencesCallback -> -- callback : TInterface (Name {namespace = "Ggit", name = "ReferencesCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Gathers references and run a callback for each one.
-- 
-- To the callback is passed the reference and the data pointer
-- passed to this function. If the callback returns something other than
-- 0, the iteration will stop and /@error@/ will be set.
repositoryReferencesForeach ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.Callbacks.ReferencesCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.ReferencesCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryReferencesForeach repository callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    callback' <- Ggit.Callbacks.mk_ReferencesCallback (Ggit.Callbacks.wrap_ReferencesCallback Nothing (Ggit.Callbacks.drop_closures_ReferencesCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_references_foreach repository' callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryReferencesForeachMethodInfo
instance (signature ~ (Ggit.Callbacks.ReferencesCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryReferencesForeachMethodInfo a signature where
    overloadedMethod = repositoryReferencesForeach

#endif

-- method Repository::references_foreach_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface
--                 Name { namespace = "Ggit" , name = "ReferencesNameCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitReferencesNameCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_references_foreach_name" ggit_repository_references_foreach_name ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    FunPtr Ggit.Callbacks.C_ReferencesNameCallback -> -- callback : TInterface (Name {namespace = "Ggit", name = "ReferencesNameCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Gathers reference names and run a callback for each one.
-- 
-- To the callback is passed the name of the reference and the data pointer
-- passed to this function. If the callback returns something other than
-- 0, the iteration will stop and /@error@/ will be set.
repositoryReferencesForeachName ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.Callbacks.ReferencesNameCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.ReferencesNameCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryReferencesForeachName repository callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    callback' <- Ggit.Callbacks.mk_ReferencesNameCallback (Ggit.Callbacks.wrap_ReferencesNameCallback Nothing (Ggit.Callbacks.drop_closures_ReferencesNameCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_references_foreach_name repository' callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryReferencesForeachNameMethodInfo
instance (signature ~ (Ggit.Callbacks.ReferencesNameCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryReferencesForeachNameMethodInfo a signature where
    overloadedMethod = repositoryReferencesForeachName

#endif

-- method Repository::remove_note
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "notes_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "canonical name of the reference to use, or %NULL to use the default ref."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "author"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "author signature." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "committer"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "committer signature."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TInterface Name { namespace = "Ggit" , name = "OId" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OID of the git object to decorate."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_remove_note" ggit_repository_remove_note ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- notes_ref : TBasicType TUTF8
    Ptr Ggit.Signature.Signature ->         -- author : TInterface (Name {namespace = "Ggit", name = "Signature"})
    Ptr Ggit.Signature.Signature ->         -- committer : TInterface (Name {namespace = "Ggit", name = "Signature"})
    Ptr Ggit.OId.OId ->                     -- id : TInterface (Name {namespace = "Ggit", name = "OId"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Removes the note for an object.
repositoryRemoveNote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (T.Text)
    -- ^ /@notesRef@/: canonical name of the reference to use, or 'P.Nothing' to use the default ref.
    -> b
    -- ^ /@author@/: author signature.
    -> c
    -- ^ /@committer@/: committer signature.
    -> Ggit.OId.OId
    -- ^ /@id@/: OID of the git object to decorate.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRemoveNote repository notesRef author committer id = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeNotesRef <- case notesRef of
        Nothing -> return nullPtr
        Just jNotesRef -> do
            jNotesRef' <- textToCString jNotesRef
            return jNotesRef'
    author' <- unsafeManagedPtrCastPtr author
    committer' <- unsafeManagedPtrCastPtr committer
    id' <- unsafeManagedPtrGetPtr id
    onException (do
        _ <- propagateGError $ ggit_repository_remove_note repository' maybeNotesRef author' committer' id'
        touchManagedPtr repository
        touchManagedPtr author
        touchManagedPtr committer
        touchManagedPtr id
        freeMem maybeNotesRef
        return ()
     ) (do
        freeMem maybeNotesRef
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRemoveNoteMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> c -> Ggit.OId.OId -> m ()), MonadIO m, IsRepository a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c) => O.MethodInfo RepositoryRemoveNoteMethodInfo a signature where
    overloadedMethod = repositoryRemoveNote

#endif

-- method Repository::remove_remote
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the remote's name." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_remove_remote" ggit_repository_remove_remote ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Removes /@remote@/ from the /@repository@/.
repositoryRemoveRemote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the remote\'s name.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRemoveRemote repository name = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    onException (do
        _ <- propagateGError $ ggit_repository_remove_remote repository' name'
        touchManagedPtr repository
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRemoveRemoteMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryRemoveRemoteMethodInfo a signature where
    overloadedMethod = repositoryRemoveRemote

#endif

-- method Repository::rename_remote
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the remote name to be renamed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "new_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new name of the remote."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_rename_remote" ggit_repository_rename_remote ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- new_name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr CString)

-- | Rename the remote of /@repository@/ from /@name@/ to /@newName@/.
repositoryRenameRemote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the remote name to be renamed.
    -> T.Text
    -- ^ /@newName@/: new name of the remote.
    -> m (Maybe [T.Text])
    -- ^ __Returns:__ non-default refspecs that
    -- cannot be renamed. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRenameRemote repository name newName = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    newName' <- textToCString newName
    onException (do
        result <- propagateGError $ ggit_repository_rename_remote repository' name' newName'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- unpackZeroTerminatedUTF8CArray result'
            mapZeroTerminatedCArray freeMem result'
            freeMem result'
            return result''
        touchManagedPtr repository
        freeMem name'
        freeMem newName'
        return maybeResult
     ) (do
        freeMem name'
        freeMem newName'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRenameRemoteMethodInfo
instance (signature ~ (T.Text -> T.Text -> m (Maybe [T.Text])), MonadIO m, IsRepository a) => O.MethodInfo RepositoryRenameRemoteMethodInfo a signature where
    overloadedMethod = repositoryRenameRemote

#endif

-- method Repository::reset
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the target #GgitObject which is a commit or a tag."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "reset_type"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "ResetType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GgitResetType to perform."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checkout_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CheckoutOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GgitCheckoutOptions to be used for a HARD reset."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_reset" ggit_repository_reset ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Object.Object ->               -- target : TInterface (Name {namespace = "Ggit", name = "Object"})
    CUInt ->                                -- reset_type : TInterface (Name {namespace = "Ggit", name = "ResetType"})
    Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- checkout_options : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Performs a reset of type /@resetType@/ on /@repository@/ to /@target@/,
-- or /@error@/ will be set.
repositoryReset ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.CheckoutOptions.IsCheckoutOptions c) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@target@/: the target t'GI.Ggit.Objects.Object.Object' which is a commit or a tag.
    -> Ggit.Enums.ResetType
    -- ^ /@resetType@/: the t'GI.Ggit.Enums.ResetType' to perform.
    -> c
    -- ^ /@checkoutOptions@/: the t'GI.Ggit.Objects.CheckoutOptions.CheckoutOptions' to be used for a HARD reset.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryReset repository target resetType checkoutOptions = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    target' <- unsafeManagedPtrCastPtr target
    let resetType' = (fromIntegral . fromEnum) resetType
    checkoutOptions' <- unsafeManagedPtrCastPtr checkoutOptions
    onException (do
        propagateGError $ ggit_repository_reset repository' target' resetType' checkoutOptions'
        touchManagedPtr repository
        touchManagedPtr target
        touchManagedPtr checkoutOptions
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryResetMethodInfo
instance (signature ~ (b -> Ggit.Enums.ResetType -> c -> m ()), MonadIO m, IsRepository a, Ggit.Object.IsObject b, Ggit.CheckoutOptions.IsCheckoutOptions c) => O.MethodInfo RepositoryResetMethodInfo a signature where
    overloadedMethod = repositoryReset

#endif

-- method Repository::reset_default
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the target #GgitObject which is a commit or a tag."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "pathspecs"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a list of file paths to reset."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_reset_default" ggit_repository_reset_default ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Object.Object ->               -- target : TInterface (Name {namespace = "Ggit", name = "Object"})
    Ptr CString ->                          -- pathspecs : TCArray True (-1) (-1) (TBasicType TUTF8)
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Update some entries in the index from the target commit tree. The scope of
-- the updated entries is determined by the paths specified in /@pathspecs@/.
-- Passing 'P.Nothing' in /@target@/ will result in removing entries in the index
-- matching the provided pathspecs.
repositoryResetDefault ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Object.IsObject b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Maybe (b)
    -- ^ /@target@/: the target t'GI.Ggit.Objects.Object.Object' which is a commit or a tag.
    -> [T.Text]
    -- ^ /@pathspecs@/: a list of file paths to reset.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryResetDefault repository target pathspecs = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    maybeTarget <- case target of
        Nothing -> return nullPtr
        Just jTarget -> do
            jTarget' <- unsafeManagedPtrCastPtr jTarget
            return jTarget'
    pathspecs' <- packZeroTerminatedUTF8CArray pathspecs
    onException (do
        propagateGError $ ggit_repository_reset_default repository' maybeTarget pathspecs'
        touchManagedPtr repository
        whenJust target touchManagedPtr
        mapZeroTerminatedCArray freeMem pathspecs'
        freeMem pathspecs'
        return ()
     ) (do
        mapZeroTerminatedCArray freeMem pathspecs'
        freeMem pathspecs'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryResetDefaultMethodInfo
instance (signature ~ (Maybe (b) -> [T.Text] -> m ()), MonadIO m, IsRepository a, Ggit.Object.IsObject b) => O.MethodInfo RepositoryResetDefaultMethodInfo a signature where
    overloadedMethod = repositoryResetDefault

#endif

-- method Repository::revert
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Commit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCommit." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RevertOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRevertOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_revert" ggit_repository_revert ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Commit.Commit ->               -- commit : TInterface (Name {namespace = "Ggit", name = "Commit"})
    Ptr Ggit.RevertOptions.RevertOptions -> -- options : TInterface (Name {namespace = "Ggit", name = "RevertOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Revert the given /@commit@/ on top of the current working directory.
repositoryRevert ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Commit.IsCommit b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@commit@/: a t'GI.Ggit.Objects.Commit.Commit'.
    -> Ggit.RevertOptions.RevertOptions
    -- ^ /@options@/: a t'GI.Ggit.Structs.RevertOptions.RevertOptions'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRevert repository commit options = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    commit' <- unsafeManagedPtrCastPtr commit
    options' <- unsafeManagedPtrGetPtr options
    onException (do
        _ <- propagateGError $ ggit_repository_revert repository' commit' options'
        touchManagedPtr repository
        touchManagedPtr commit
        touchManagedPtr options
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRevertMethodInfo
instance (signature ~ (b -> Ggit.RevertOptions.RevertOptions -> m ()), MonadIO m, IsRepository a, Ggit.Commit.IsCommit b) => O.MethodInfo RepositoryRevertMethodInfo a signature where
    overloadedMethod = repositoryRevert

#endif

-- method Repository::revparse
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "spec"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the revision specification."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Object" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_revparse" ggit_repository_revparse ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- spec : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.Object.Object)

-- | Find an object, as specified by a revision string. See @man gitrevisions@,
-- or the documentation for @git rev-parse@ for information on the syntax
-- accepted.
repositoryRevparse ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@spec@/: the revision specification.
    -> m (Maybe Ggit.Object.Object)
    -- ^ __Returns:__ a t'GI.Ggit.Objects.Object.Object' or 'P.Nothing' if the revision could not be found. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryRevparse repository spec = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    spec' <- textToCString spec
    onException (do
        result <- propagateGError $ ggit_repository_revparse repository' spec'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Ggit.Object.Object) result'
            return result''
        touchManagedPtr repository
        freeMem spec'
        return maybeResult
     ) (do
        freeMem spec'
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryRevparseMethodInfo
instance (signature ~ (T.Text -> m (Maybe Ggit.Object.Object)), MonadIO m, IsRepository a) => O.MethodInfo RepositoryRevparseMethodInfo a signature where
    overloadedMethod = repositoryRevparse

#endif

-- method Repository::save_stash
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "stasher"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Signature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitSignature." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "description along with the stashed state or %NULL to be autogenerated."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "StashFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GgitStashFlags to control the stashing process."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_save_stash" ggit_repository_save_stash ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Ggit.Signature.Signature ->         -- stasher : TInterface (Name {namespace = "Ggit", name = "Signature"})
    CString ->                              -- message : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Ggit", name = "StashFlags"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Ggit.OId.OId)

-- | Saves the local modifications to a new stash.
-- It returns the commit containing the stashed state.
-- This commit is also the target of the direct reference refs\/stash.
repositorySaveStash ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Ggit.Signature.IsSignature b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@stasher@/: a t'GI.Ggit.Objects.Signature.Signature'.
    -> T.Text
    -- ^ /@message@/: description along with the stashed state or 'P.Nothing' to be autogenerated.
    -> [Ggit.Flags.StashFlags]
    -- ^ /@flags@/: a t'GI.Ggit.Flags.StashFlags' to control the stashing process.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ a new object id of the commit containing the stashed state. /(Can throw 'Data.GI.Base.GError.GError')/
repositorySaveStash repository stasher message flags = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    stasher' <- unsafeManagedPtrCastPtr stasher
    message' <- textToCString message
    let flags' = gflagsToWord flags
    onException (do
        result <- propagateGError $ ggit_repository_save_stash repository' stasher' message' flags'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapBoxed Ggit.OId.OId) result'
            return result''
        touchManagedPtr repository
        touchManagedPtr stasher
        freeMem message'
        return maybeResult
     ) (do
        freeMem message'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySaveStashMethodInfo
instance (signature ~ (b -> T.Text -> [Ggit.Flags.StashFlags] -> m (Maybe Ggit.OId.OId)), MonadIO m, IsRepository a, Ggit.Signature.IsSignature b) => O.MethodInfo RepositorySaveStashMethodInfo a signature where
    overloadedMethod = repositorySaveStash

#endif

-- method Repository::set_head
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "canonical name of the reference HEAD should point to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_set_head" ggit_repository_set_head ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- ref_name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | /No description available in the introspection data./
repositorySetHead ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@refName@/: canonical name of the reference HEAD should point to.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySetHead repository refName = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    refName' <- textToCString refName
    onException (do
        _ <- propagateGError $ ggit_repository_set_head repository' refName'
        touchManagedPtr repository
        freeMem refName'
        return ()
     ) (do
        freeMem refName'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySetHeadMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySetHeadMethodInfo a signature where
    overloadedMethod = repositorySetHead

#endif

-- method Repository::set_remote_url
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the remote name who's url is to be set."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "url"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "url of the remote." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_set_remote_url" ggit_repository_set_remote_url ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- remote : TBasicType TUTF8
    CString ->                              -- url : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Sets url for the /@remote@/ from the /@repository@/.
repositorySetRemoteUrl ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@remote@/: the remote name who\'s url is to be set.
    -> T.Text
    -- ^ /@url@/: url of the remote.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySetRemoteUrl repository remote url = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    remote' <- textToCString remote
    url' <- textToCString url
    onException (do
        _ <- propagateGError $ ggit_repository_set_remote_url repository' remote' url'
        touchManagedPtr repository
        freeMem remote'
        freeMem url'
        return ()
     ) (do
        freeMem remote'
        freeMem url'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySetRemoteUrlMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySetRemoteUrlMethodInfo a signature where
    overloadedMethod = repositorySetRemoteUrl

#endif

-- method Repository::set_submodule_fetch_recurse
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the submodule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "fetch_recurse_submodules"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "SubmoduleRecurse" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitSubmoduleRecurse."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_set_submodule_fetch_recurse" ggit_repository_set_submodule_fetch_recurse ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CUInt ->                                -- fetch_recurse_submodules : TInterface (Name {namespace = "Ggit", name = "SubmoduleRecurse"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Sets the submodule.\'name\'.fetchRecurseSubmodules value for
-- the submodule. This setting won\'t affect any existing instances..
repositorySetSubmoduleFetchRecurse ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the submodule.
    -> Ggit.Enums.SubmoduleRecurse
    -- ^ /@fetchRecurseSubmodules@/: a t'GI.Ggit.Enums.SubmoduleRecurse'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySetSubmoduleFetchRecurse repository name fetchRecurseSubmodules = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    let fetchRecurseSubmodules' = (fromIntegral . fromEnum) fetchRecurseSubmodules
    onException (do
        propagateGError $ ggit_repository_set_submodule_fetch_recurse repository' name' fetchRecurseSubmodules'
        touchManagedPtr repository
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySetSubmoduleFetchRecurseMethodInfo
instance (signature ~ (T.Text -> Ggit.Enums.SubmoduleRecurse -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySetSubmoduleFetchRecurseMethodInfo a signature where
    overloadedMethod = repositorySetSubmoduleFetchRecurse

#endif

-- method Repository::set_submodule_ignore
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the submodule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ignore"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "SubmoduleIgnore" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitSubmoduleIgnore."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_set_submodule_ignore" ggit_repository_set_submodule_ignore ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CInt ->                                 -- ignore : TInterface (Name {namespace = "Ggit", name = "SubmoduleIgnore"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Sets the ignore rule for the submodule in the configuration.
-- This does not affect any currently-loaded instances..
repositorySetSubmoduleIgnore ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the submodule.
    -> Ggit.Enums.SubmoduleIgnore
    -- ^ /@ignore@/: a t'GI.Ggit.Enums.SubmoduleIgnore'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySetSubmoduleIgnore repository name ignore = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    let ignore' = (fromIntegral . fromEnum) ignore
    onException (do
        propagateGError $ ggit_repository_set_submodule_ignore repository' name' ignore'
        touchManagedPtr repository
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySetSubmoduleIgnoreMethodInfo
instance (signature ~ (T.Text -> Ggit.Enums.SubmoduleIgnore -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySetSubmoduleIgnoreMethodInfo a signature where
    overloadedMethod = repositorySetSubmoduleIgnore

#endif

-- method Repository::set_submodule_update
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the submodule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "update"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "SubmoduleUpdate" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitSubmoduleUpdate."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_set_submodule_update" ggit_repository_set_submodule_update ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CUInt ->                                -- update : TInterface (Name {namespace = "Ggit", name = "SubmoduleUpdate"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Sets the update rule for the submodule in the configuration.
-- This setting won\'t affect any existing instances.
repositorySetSubmoduleUpdate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the submodule.
    -> Ggit.Enums.SubmoduleUpdate
    -- ^ /@update@/: a t'GI.Ggit.Enums.SubmoduleUpdate'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySetSubmoduleUpdate repository name update = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    let update' = (fromIntegral . fromEnum) update
    onException (do
        propagateGError $ ggit_repository_set_submodule_update repository' name' update'
        touchManagedPtr repository
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySetSubmoduleUpdateMethodInfo
instance (signature ~ (T.Text -> Ggit.Enums.SubmoduleUpdate -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySetSubmoduleUpdateMethodInfo a signature where
    overloadedMethod = repositorySetSubmoduleUpdate

#endif

-- method Repository::set_submodule_url
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the submodule to configure."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "url"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "URL that should be used for the submodule."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_set_submodule_url" ggit_repository_set_submodule_url ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- url : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Sets the URL for the submodule in the configuration.
-- 
-- After calling this, you may wish to call 'GI.Ggit.Structs.Submodule.submoduleSync' to
-- write the changes to the checked out submodule repository.
repositorySetSubmoduleUrl ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> T.Text
    -- ^ /@name@/: the name of the submodule to configure.
    -> T.Text
    -- ^ /@url@/: URL that should be used for the submodule.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySetSubmoduleUrl repository name url = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    name' <- textToCString name
    url' <- textToCString url
    onException (do
        propagateGError $ ggit_repository_set_submodule_url repository' name' url'
        touchManagedPtr repository
        freeMem name'
        freeMem url'
        return ()
     ) (do
        freeMem name'
        freeMem url'
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySetSubmoduleUrlMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySetSubmoduleUrlMethodInfo a signature where
    overloadedMethod = repositorySetSubmoduleUrl

#endif

-- method Repository::set_workdir
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "workdir"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the working directory."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "update_gitlink"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "create/update gitlink in workdir."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ggit_repository_set_workdir" ggit_repository_set_workdir ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    Ptr Gio.File.File ->                    -- workdir : TInterface (Name {namespace = "Gio", name = "File"})
    CInt ->                                 -- update_gitlink : TBasicType TBoolean
    IO ()

-- | Sets the working directory of the repository. If /@updateGitlink@/ is set to
-- 'P.True' \"core.worktree\" will be set in the config if workdir is not the parent
-- of the .git directory).
repositorySetWorkdir ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a, Gio.File.IsFile b) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> b
    -- ^ /@workdir@/: the working directory.
    -> Bool
    -- ^ /@updateGitlink@/: create\/update gitlink in workdir.
    -> m ()
repositorySetWorkdir repository workdir updateGitlink = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    workdir' <- unsafeManagedPtrCastPtr workdir
    let updateGitlink' = (fromIntegral . fromEnum) updateGitlink
    ggit_repository_set_workdir repository' workdir' updateGitlink'
    touchManagedPtr repository
    touchManagedPtr workdir
    return ()

#if defined(ENABLE_OVERLOADING)
data RepositorySetWorkdirMethodInfo
instance (signature ~ (b -> Bool -> m ()), MonadIO m, IsRepository a, Gio.File.IsFile b) => O.MethodInfo RepositorySetWorkdirMethodInfo a signature where
    overloadedMethod = repositorySetWorkdir

#endif

-- method Repository::stash_foreach
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "StashCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitStashCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_stash_foreach" ggit_repository_stash_foreach ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    FunPtr Ggit.Callbacks.C_StashCallback -> -- callback : TInterface (Name {namespace = "Ggit", name = "StashCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Loops over all the stashed states and issue a callback for each one.
-- If /@callback@/ returns a non-zero value, this will stop looping.
repositoryStashForeach ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.Callbacks.StashCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.StashCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryStashForeach repository callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    callback' <- Ggit.Callbacks.mk_StashCallback (Ggit.Callbacks.wrap_StashCallback Nothing (Ggit.Callbacks.drop_closures_StashCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_stash_foreach repository' callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryStashForeachMethodInfo
instance (signature ~ (Ggit.Callbacks.StashCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryStashForeachMethodInfo a signature where
    overloadedMethod = repositoryStashForeach

#endif

-- method Repository::submodule_foreach
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "SubmoduleCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitStatusCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_submodule_foreach" ggit_repository_submodule_foreach ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    FunPtr Ggit.Callbacks.C_SubmoduleCallback -> -- callback : TInterface (Name {namespace = "Ggit", name = "SubmoduleCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Gathers submodules and run a callback for each one.
-- 
-- To the callback is passed the submodule instance and name. If the callback
-- returns something other than 0, the iteration will stop and /@error@/
-- will be set.
-- 
-- NOTE: the submodule instance passed to the callback is only valid during
-- the call to ggit_repository_submodule_foreach and may not be used after the
-- call has finished.
repositorySubmoduleForeach ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.Callbacks.SubmoduleCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.StatusCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositorySubmoduleForeach repository callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    callback' <- Ggit.Callbacks.mk_SubmoduleCallback (Ggit.Callbacks.wrap_SubmoduleCallback Nothing (Ggit.Callbacks.drop_closures_SubmoduleCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_submodule_foreach repository' callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositorySubmoduleForeachMethodInfo
instance (signature ~ (Ggit.Callbacks.SubmoduleCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositorySubmoduleForeachMethodInfo a signature where
    overloadedMethod = repositorySubmoduleForeach

#endif

-- method Repository::tag_foreach
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repository"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "Repository" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRepository." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "TagCallback" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitTagCallback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_tag_foreach" ggit_repository_tag_foreach ::
    Ptr Repository ->                       -- repository : TInterface (Name {namespace = "Ggit", name = "Repository"})
    FunPtr Ggit.Callbacks.C_TagCallback ->  -- callback : TInterface (Name {namespace = "Ggit", name = "TagCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Get all the tags in the repository and run the provided callback on each. If
-- the callback returns something other than 0, the iteration will stop and
-- /@error@/ will be set.
repositoryTagForeach ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepository a) =>
    a
    -- ^ /@repository@/: a t'GI.Ggit.Objects.Repository.Repository'.
    -> Ggit.Callbacks.TagCallback
    -- ^ /@callback@/: a t'GI.Ggit.Callbacks.TagCallback'.
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repositoryTagForeach repository callback = liftIO $ do
    repository' <- unsafeManagedPtrCastPtr repository
    callback' <- Ggit.Callbacks.mk_TagCallback (Ggit.Callbacks.wrap_TagCallback Nothing (Ggit.Callbacks.drop_closures_TagCallback callback))
    let userData = nullPtr
    onException (do
        _ <- propagateGError $ ggit_repository_tag_foreach repository' callback' userData
        safeFreeFunPtr $ castFunPtrToPtr callback'
        touchManagedPtr repository
        return ()
     ) (do
        safeFreeFunPtr $ castFunPtrToPtr callback'
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepositoryTagForeachMethodInfo
instance (signature ~ (Ggit.Callbacks.TagCallback -> m ()), MonadIO m, IsRepository a) => O.MethodInfo RepositoryTagForeachMethodInfo a signature where
    overloadedMethod = repositoryTagForeach

#endif

-- method Repository::clone
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "url"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "url to fetch the repository from."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "location"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the location of the repository."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CloneOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitCloneOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Repository" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_clone" ggit_repository_clone ::
    CString ->                              -- url : TBasicType TUTF8
    Ptr Gio.File.File ->                    -- location : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Ggit.CloneOptions.CloneOptions ->   -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Repository)

-- | Clones a new git repository in the given folder.
repositoryClone ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Ggit.CloneOptions.IsCloneOptions b) =>
    T.Text
    -- ^ /@url@/: url to fetch the repository from.
    -> a
    -- ^ /@location@/: the location of the repository.
    -> Maybe (b)
    -- ^ /@options@/: a t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> m (Maybe Repository)
    -- ^ __Returns:__ a newly created t'GI.Ggit.Objects.Repository.Repository'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryClone url location options = liftIO $ do
    url' <- textToCString url
    location' <- unsafeManagedPtrCastPtr location
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrCastPtr jOptions
            return jOptions'
    onException (do
        result <- propagateGError $ ggit_repository_clone url' location' maybeOptions
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Repository) result'
            return result''
        touchManagedPtr location
        whenJust options touchManagedPtr
        freeMem url'
        return maybeResult
     ) (do
        freeMem url'
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Repository::discover
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "location"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the base location where the lookup starts."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "File" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_discover" ggit_repository_discover ::
    Ptr Gio.File.File ->                    -- location : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gio.File.File)

-- | Looks for a git repository.
-- 
-- The lookup starts from /@path@/ and walks up the parent directories
-- and stops when a repository is found.
repositoryDiscover ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
    a
    -- ^ /@location@/: the base location where the lookup starts.
    -> m (Maybe Gio.File.File)
    -- ^ __Returns:__ the repository location. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryDiscover location = liftIO $ do
    location' <- unsafeManagedPtrCastPtr location
    onException (do
        result <- propagateGError $ ggit_repository_discover location'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Gio.File.File) result'
            return result''
        touchManagedPtr location
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Repository::discover_full
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "location"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the base location where the lookup starts."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "across_fs"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "indictaes whether lookup will work across filesystem devices."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ceiling_dirs"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a list of absolute paths\n  at which lookup will stop when reached, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "File" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_discover_full" ggit_repository_discover_full ::
    Ptr Gio.File.File ->                    -- location : TInterface (Name {namespace = "Gio", name = "File"})
    CInt ->                                 -- across_fs : TBasicType TBoolean
    Ptr CString ->                          -- ceiling_dirs : TCArray True (-1) (-1) (TBasicType TUTF8)
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gio.File.File)

-- | Looks for a git repository.
-- 
-- The lookup starts from /@path@/ and walks up the parent directories
-- and stops when a repository is found.
repositoryDiscoverFull ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
    a
    -- ^ /@location@/: the base location where the lookup starts.
    -> Bool
    -- ^ /@acrossFs@/: indictaes whether lookup will work across filesystem devices.
    -> Maybe ([T.Text])
    -- ^ /@ceilingDirs@/: a list of absolute paths
    --   at which lookup will stop when reached, or 'P.Nothing'.
    -> m (Maybe Gio.File.File)
    -- ^ __Returns:__ the repository location. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryDiscoverFull location acrossFs ceilingDirs = liftIO $ do
    location' <- unsafeManagedPtrCastPtr location
    let acrossFs' = (fromIntegral . fromEnum) acrossFs
    maybeCeilingDirs <- case ceilingDirs of
        Nothing -> return nullPtr
        Just jCeilingDirs -> do
            jCeilingDirs' <- packZeroTerminatedUTF8CArray jCeilingDirs
            return jCeilingDirs'
    onException (do
        result <- propagateGError $ ggit_repository_discover_full location' acrossFs' maybeCeilingDirs
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Gio.File.File) result'
            return result''
        touchManagedPtr location
        mapZeroTerminatedCArray freeMem maybeCeilingDirs
        freeMem maybeCeilingDirs
        return maybeResult
     ) (do
        mapZeroTerminatedCArray freeMem maybeCeilingDirs
        freeMem maybeCeilingDirs
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Repository::init_repository
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "location"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the location of the repository."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_bare"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if %TRUE, a git repository without a working directory is created\n          at the pointed path. If %FALSE, provided path will be considered as the working\n          directory into which the .git directory will be created."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Repository" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_init_repository" ggit_repository_init_repository ::
    Ptr Gio.File.File ->                    -- location : TInterface (Name {namespace = "Gio", name = "File"})
    CInt ->                                 -- is_bare : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Repository)

-- | Creates a new git repository in the given folder.
repositoryInitRepository ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
    a
    -- ^ /@location@/: the location of the repository.
    -> Bool
    -- ^ /@isBare@/: if 'P.True', a git repository without a working directory is created
    --           at the pointed path. If 'P.False', provided path will be considered as the working
    --           directory into which the .git directory will be created.
    -> m (Maybe Repository)
    -- ^ __Returns:__ a newly created t'GI.Ggit.Objects.Repository.Repository'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryInitRepository location isBare = liftIO $ do
    location' <- unsafeManagedPtrCastPtr location
    let isBare' = (fromIntegral . fromEnum) isBare
    onException (do
        result <- propagateGError $ ggit_repository_init_repository location' isBare'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Repository) result'
            return result''
        touchManagedPtr location
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Repository::open
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "location"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the location of the repository."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "Repository" })
-- throws : True
-- Skip return : False

foreign import ccall "ggit_repository_open" ggit_repository_open ::
    Ptr Gio.File.File ->                    -- location : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Repository)

-- | Open a git repository.
-- 
-- The /@path@/ must point to an existing git repository folder, e.g.
-- 
-- 	\/path\/to\/my_repo\/.git\/	(normal repository)
-- 						objects\/
-- 						index
-- 						HEAD
-- 
-- 	\/path\/to\/bare_repo\/		(bare repository)
-- 					objects\/
-- 					index
-- 					HEAD
-- 
-- The method will automatically detect if /@path@/ is a normal
-- or bare repository or fail if it is neither.
repositoryOpen ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
    a
    -- ^ /@location@/: the location of the repository.
    -> m (Maybe Repository)
    -- ^ __Returns:__ a newly created t'GI.Ggit.Objects.Repository.Repository'. /(Can throw 'Data.GI.Base.GError.GError')/
repositoryOpen location = liftIO $ do
    location' <- unsafeManagedPtrCastPtr location
    onException (do
        result <- propagateGError $ ggit_repository_open location'
        maybeResult <- convertIfNonNull result $ \result' -> do
            result'' <- (wrapObject Repository) result'
            return result''
        touchManagedPtr location
        return maybeResult
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif