GitRepo

The structure representing a git repository.

Constructors

this
this(git_repository* payload)
Undocumented in source.
this
deprecated this(char[] path)

Open a git repository.

Members

Functions

addIgnoreRules
void addIgnoreRules(const(char)[][] rules)

Add one or more ignore rules to this repository.

cleanupMerge
void cleanupMerge()

Remove all the metadata associated with an ongoing git merge, including MERGE_HEAD, MERGE_MSG, etc.

clearIgnoreRules
void clearIgnoreRules()

Clear ignore rules that were explicitly added.

getFetchHeadItems
FetchHeadItem[] getFetchHeadItems()

Return the list of items in the FETCH_HEAD file as an array of FetchHeadItem's.

getFetchHeadItems
Range getFetchHeadItems(Range sink)

Read each item in the FETCH_HEAD file to the output range sink, and return the sink.

getMergeHeadItems
MergeHeadItem[] getMergeHeadItems()

Return the list of items in the MERGE_HEAD file as an array of MergeHeadItem's.

getMergeHeadItems
Range getMergeHeadItems(Range sink)

Read each item in the MERGE_HEAD file to the output range sink, and return the sink.

hashFile
GitOid hashFile(char[] path, GitType type, char[] asPath)

Calculate hash of file using repository filtering rules.

isPathIgnored
bool isPathIgnored(char[] path)

Test if the ignore rules apply to a given path.

removeMergeMsg
void removeMergeMsg()

Remove the merge message file for this repository. If the message file does not exist GitException is thrown. Use mergeMsgExists to check whether the merge message file exists.

setHead
void setHead(char[] refName)

Make the repository HEAD point to the specified reference.

setWorkPath
void setWorkPath(char[] newWorkPath, UpdateGitlink updateGitlink)

Set the work path of this repository.

walkFetchHead
void walkFetchHead(FetchHeadFunction callback)
void walkFetchHead(FetchHeadDelegate callback)

Call the callback function for each entry in the FETCH_HEAD file in this repository.

walkFetchHead
auto walkFetchHead()

Walk the FETCH_HEAD file in a foreach loop.

walkMergeHead
void walkMergeHead(MergeHeadFunction callback)
void walkMergeHead(MergeHeadDelegate callback)

Call the callback function for each entry in the MERGE_HEAD file in this repository.

walkMergeHead
auto walkMergeHead()

Walk the MERGE_HEAD file in a foreach loop.

Mixins

__anonymous
mixin RefCountedGitObject!(git_repository, git_repository_free)
Undocumented in source.

Properties

head
GitReference head [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
index
GitIndex index [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
isBare
bool isBare [@property getter]

Check if this repository is a bare repository.

isEmpty
bool isEmpty [@property getter]

Check if this repository is empty.

isHeadDetached
bool isHeadDetached [@property getter]

Check if this repository's HEAD is detached.

isHeadOrphan
bool isHeadOrphan [@property getter]

Check if the current branch is an orphan.

isShallow
bool isShallow [@property getter]

Determine if this repository is a shallow clone.

mergeMsg
string mergeMsg [@property getter]

Retrieve the merge message for this repository.

mergeMsgExists
bool mergeMsgExists [@property getter]

Check if the merge message file exists for this repository.

namespace
string namespace [@property getter]

Get the currently active namespace for this repository.

namespace
char[] namespace [@property setter]

Set the active namespace for this repository.

path
string path [@property getter]

Get the path of this repository.

state
RepoState state [@property getter]

Return the current state this repository, e.g. whether an operation such as merge is in progress.

workPath
string workPath [@property getter]

Get the path of the working directory of this repository.

Examples

Default-construction is disabled

static assert(!__traits(compiles, GitRepo()));

Meta