gi-ggit-1.0.8: libgit2-glib bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Ggit.Objects.Index

Description

Represents an index object.

Synopsis

Exported types

newtype Index Source #

Memory-managed wrapper type.

Constructors

Index (ManagedPtr Index) 

Instances

Instances details
Eq Index Source # 
Instance details

Defined in GI.Ggit.Objects.Index

Methods

(==) :: Index -> Index -> Bool #

(/=) :: Index -> Index -> Bool #

IsGValue Index Source #

Convert Index to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Ggit.Objects.Index

GObject Index Source # 
Instance details

Defined in GI.Ggit.Objects.Index

Methods

gobjectType :: IO GType #

HasParentTypes Index Source # 
Instance details

Defined in GI.Ggit.Objects.Index

type ParentTypes Index Source # 
Instance details

Defined in GI.Ggit.Objects.Index

class (GObject o, IsDescendantOf Index o) => IsIndex o Source #

Type class for types which can be safely cast to Index, for instance with toIndex.

Instances

Instances details
(GObject o, IsDescendantOf Index o) => IsIndex o Source # 
Instance details

Defined in GI.Ggit.Objects.Index

toIndex :: (MonadIO m, IsIndex o) => o -> m Index Source #

Cast to Index, for types for which this is known to be safe. For general casts, use castTo.

noIndex :: Maybe Index Source #

A convenience alias for Nothing :: Maybe Index.

Methods

Overloaded methods

add

indexAdd Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> IndexEntry

entry: a IndexEntry.

-> m ()

(Can throw GError)

Add a file to the index.

addFile

indexAddFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a, IsFile b) 
=> a

idx: a Index.

-> b

file: file to add.

-> m ()

(Can throw GError)

Add a file to the index. The specified file must be in the working directory and must exist and be readable.

addPath

indexAddPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> Text

path: path to the file to add.

-> m ()

(Can throw GError)

Add a file to the index by path. You can specify both relative paths (to the working directory) and absolute paths. Absolute paths however must reside in the working directory. The specified path must exist and must be readable.

getEntries

indexGetEntries Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> m (Maybe IndexEntries)

Returns: a IndexEntries or Nothing.

Get the index entries enumerator.

getEntriesResolveUndo

indexGetEntriesResolveUndo Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> m (Maybe IndexEntriesResolveUndo)

Returns: a IndexEntriesResolveUndo or Nothing.

Get the resolve undo entries enumerator.

getOwner

indexGetOwner Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> m (Maybe Repository)

Returns: the Repository that owns this index or Nothing.

Get the Repository that owns the index.

hasConflicts

indexHasConflicts Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> m Bool

Returns: True if the index has any conflicts, False otherwise.

Get whether the index has any conflicts.

open

indexOpen Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) 
=> a

file: a File.

-> m (Maybe Index)

Returns: a Index or Nothing if an error occurred. (Can throw GError)

Create a new bare Git index object as a memory representation of the Git index file in file, without a repository to back it.

read

indexRead Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> Bool

force: force read even if there are in-memory changes.

-> m ()

(Can throw GError)

Update the contents of an existing index object in memory by reading from the hard disk.

If force is true, this performs a "hard" read that discards in-memory changes and always reloads the on-disk index data. If there is no on-disk version, the index will be cleared.

If force is false, this does a "soft" read that reloads the index data from disk only if it has changed since the last time it was loaded. Purely in-memory index data will be untouched. Be aware: if there are changes on disk, unwritten in-memory changes are discarded.

remove

indexRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a, IsFile b) 
=> a

idx: a Index.

-> b

file: the file to search.

-> Int32

stage: the stage to search.

-> m ()

(Can throw GError)

Remove a file from the index (specified by position).

write

indexWrite Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> m ()

(Can throw GError)

Write an existing index object from memory back to disk using an atomic file lock.

writeTree

indexWriteTree Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a) 
=> a

idx: a Index.

-> m (Maybe OId)

Returns: a OId or Nothing in case of an error. (Can throw GError)

Write a new tree object to disk containing a representation of the current state of the index. The index must be associated to an existing repository and must not contain any files in conflict. You can use the resulting tree to for instance create a commit.

writeTreeTo

indexWriteTreeTo Source #

Arguments

:: (HasCallStack, MonadIO m, IsIndex a, IsRepository b) 
=> a

idx: a Index.

-> b

repository: a Repository.

-> m (Maybe OId)

Returns: a OId or Nothing in case of an error. (Can throw GError)

Write a new tree object to repository containing a representation of the current state of the index. The index must not contain any files in conflict. You can use the resulting tree to for instance create a commit.

Properties

file

No description available in the introspection data.

constructIndexFile :: (IsIndex o, IsFile a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “file” property. This is rarely needed directly, but it is used by new.

getIndexFile :: (MonadIO m, IsIndex o) => o -> m (Maybe File) Source #

Get the value of the “file” property. When overloading is enabled, this is equivalent to

get index #file