Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Represents an index object.
Synopsis
- newtype Index = Index (ManagedPtr Index)
- class (GObject o, IsDescendantOf Index o) => IsIndex o
- toIndex :: (MonadIO m, IsIndex o) => o -> m Index
- noIndex :: Maybe Index
- indexAdd :: (HasCallStack, MonadIO m, IsIndex a) => a -> IndexEntry -> m ()
- indexAddFile :: (HasCallStack, MonadIO m, IsIndex a, IsFile b) => a -> b -> m ()
- indexAddPath :: (HasCallStack, MonadIO m, IsIndex a) => a -> Text -> m ()
- indexGetEntries :: (HasCallStack, MonadIO m, IsIndex a) => a -> m (Maybe IndexEntries)
- indexGetEntriesResolveUndo :: (HasCallStack, MonadIO m, IsIndex a) => a -> m (Maybe IndexEntriesResolveUndo)
- indexGetOwner :: (HasCallStack, MonadIO m, IsIndex a) => a -> m (Maybe Repository)
- indexHasConflicts :: (HasCallStack, MonadIO m, IsIndex a) => a -> m Bool
- indexOpen :: (HasCallStack, MonadIO m, IsFile a) => a -> m (Maybe Index)
- indexRead :: (HasCallStack, MonadIO m, IsIndex a) => a -> Bool -> m ()
- indexRemove :: (HasCallStack, MonadIO m, IsIndex a, IsFile b) => a -> b -> Int32 -> m ()
- indexWrite :: (HasCallStack, MonadIO m, IsIndex a) => a -> m ()
- indexWriteTree :: (HasCallStack, MonadIO m, IsIndex a) => a -> m (Maybe OId)
- indexWriteTreeTo :: (HasCallStack, MonadIO m, IsIndex a, IsRepository b) => a -> b -> m (Maybe OId)
- constructIndexFile :: (IsIndex o, IsFile a) => a -> IO (GValueConstruct o)
- getIndexFile :: (MonadIO m, IsIndex o) => o -> m (Maybe File)
Exported types
Memory-managed wrapper type.
Instances
GObject Index Source # | |
Defined in GI.Ggit.Objects.Index gobjectType :: IO GType # | |
HasParentTypes Index Source # | |
Defined in GI.Ggit.Objects.Index | |
type ParentTypes Index Source # | |
Defined in GI.Ggit.Objects.Index |
class (GObject o, IsDescendantOf Index o) => IsIndex o Source #
Instances
(GObject o, IsDescendantOf Index o) => IsIndex o Source # | |
Defined in GI.Ggit.Objects.Index |
Methods
add
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> IndexEntry |
|
-> m () | (Can throw |
Add a file to the index.
addFile
:: (HasCallStack, MonadIO m, IsIndex a, IsFile b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Add a file to the index. The specified file must be in the working directory and must exist and be readable.
addPath
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
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
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> m (Maybe IndexEntries) | Returns: a |
Get the index entries enumerator.
getEntriesResolveUndo
indexGetEntriesResolveUndo Source #
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> m (Maybe IndexEntriesResolveUndo) | Returns: a |
Get the resolve undo entries enumerator.
getOwner
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> m (Maybe Repository) | Returns: the |
Get the Repository
that owns the index.
hasConflicts
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> m Bool | Returns: |
Get whether the index has any conflicts.
open
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m (Maybe Index) | Returns: a |
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
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> Bool |
|
-> m () | (Can throw |
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
:: (HasCallStack, MonadIO m, IsIndex a, IsFile b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m () | (Can throw |
Remove a file from the index (specified by position).
write
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> m () | (Can throw |
Write an existing index object from memory back to disk using an atomic file lock.
writeTree
:: (HasCallStack, MonadIO m, IsIndex a) | |
=> a |
|
-> m (Maybe OId) | Returns: a |
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
:: (HasCallStack, MonadIO m, IsIndex a, IsRepository b) | |
=> a |
|
-> b |
|
-> m (Maybe OId) | Returns: a |
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