GitDir class

Represents a local directory

Properties

hashCode int
The hash code for this object.
no setterinherited
path String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

branches() Future<List<BranchReference>>
branchReference(String branchName) Future<BranchReference?>
commitCount([String branchName = 'HEAD']) Future<int>
commitFromRevision(String revision) Future<Commit>
revision should probably be a sha1 to a commit. But GIT lets you do other things. See http://git-scm.com/docs/gitrevisions.html
commits([String branchName = 'HEAD']) Future<Map<String, Commit>>
commitTree(String treeSha, String commitMessage, {List<String>? parentCommitShas}) Future<String>
Returns the SHA1 for the new commit.
createOrUpdateBranch(String branchName, String treeSha, String commitMessage) Future<String?>
Returns the SHA for the new commit if one is created.
currentBranch() Future<BranchReference>
isWorkingTreeClean() Future<bool>
lsTree(String treeish, {bool subTreesOnly = false, String? path}) Future<List<TreeEntry>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runCommand(Iterable<String> args, {bool throwOnError = true, bool echoOutput = false}) Future<ProcessResult>
If echoOutput is true, the output of the git command will be echoed. Note: echoOutput true will also cause the returned ProcessResult to have null values for ProcessResult.stdout and ProcessResult.stderr.
showRef({bool heads = false, bool tags = false}) Future<List<CommitReference>>
tags() Stream<Tag>
toString() String
A string representation of this object.
inherited
updateBranch(String branchName, Future<void> populater(Directory td), String commitMessage) Future<Commit?>
Updates the named branch with the content add by calling populater.
updateBranchWithDirectoryContents(String branchName, String sourceDirectoryPath, String commitMessage) Future<Commit?>
writeObjects(List<String> paths) Future<Map<String, String>>
Given a list of paths, write those files to the object store and return a Map where the key is the input path and the value is the SHA of the newly written object.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromExisting(String gitDirRoot, {bool allowSubdirectory = false}) Future<GitDir>
If allowSubdirectory is true, a GitDir may be returned if gitDirRoot is a subdirectory within a Git repository.
init(String path, {bool allowContent = false, String? initialBranch}) Future<GitDir>
allowContent if true, doesn't check to see if the directory is empty
isGitDir(String path) Future<bool>