br.com.objectos.git
Interface GitCommandExecutor

All Superinterfaces:
GitExecutor

public interface GitCommandExecutor
extends GitExecutor

Interface for supporting the execution of GitCommand instances. It gives GitCommands access to low-level (plumbing) git tasks while abstracting away the mechanics of concurrency and multithreading.

Users should use StageGitCommand instead of using this class directly.

Since:
3

Method Summary
 Computation<ImmutableSet<ObjectId>> copyObjects(Repository source, ImmutableSet<ObjectId> objects, Repository destination)
          Returns a new computation for copying a set of objects from one repository to another.
 Computation<MaterializedEntry> materializeEntry(Repository repository, Entry entry, Directory target)
          Returns a new computation for materializing a Git tree entry at the specified target directory.
 Computation<Repository> openRepository(Directory directory)
          Returns a new computation for opening a Git repository located at the specified directory.
 Computation<Blob> readBlob(Repository repository, ObjectId id)
          Returns a new computation for reading a blob object from a repository.
 Computation<Commit> readCommit(Repository repository, ObjectId id)
          Returns a new computation for reading a commit object from a repository.
 Computation<Tree> readTree(Repository repository, ObjectId id)
          Returns a new computation for reading a tree object from a repository.
 Computation<MaybeObjectId> resolve(Repository repository, RefName ref)
          Returns a new computation for resolving a Git reference.
 Computation<MaybeObjectId> updateRef(Repository repository, RefName ref, ObjectId newValue)
          Returns a new computation for updating a Git reference.
 Computation<ObjectId> writeCommit(Repository repository, MutableCommit commit)
          Returns a new computation for writing a commit object (as a loose object) to a repository.
 Computation<ObjectId> writeTree(GitCommand<?> command, Repository repository, MutableTree tree)
          Returns a new computation for recursively writing tree objects to a repository.
 
Methods inherited from interface br.com.objectos.git.GitExecutor
submit
 

Method Detail

copyObjects

Computation<ImmutableSet<ObjectId>> copyObjects(Repository source,
                                                ImmutableSet<ObjectId> objects,
                                                Repository destination)
Returns a new computation for copying a set of objects from one repository to another.

This is the asynchronous execution of the GitEngine.copyObjects(Repository, ImmutableSet, Repository) task.

Parameters:
source - the source repository containing the objects. Git objects will be read from this repository.
objects - the ids (hash values) of the objects to be copied
destination - the destination repository. Git objects will (possibly) be written to this repository
Returns:
a new computation for copying a set of objects from one repository to another

materializeEntry

Computation<MaterializedEntry> materializeEntry(Repository repository,
                                                Entry entry,
                                                Directory target)
Returns a new computation for materializing a Git tree entry at the specified target directory.

This is the asynchronous execution of the GitEngine.materializeEntry(Repository, Entry, Directory) task.

Parameters:
repository - repository to read blob contents from (if necessary)
entry - the entry to be materialized
target - the target directory
Returns:
a new computation for materializing a Git tree entry at the specified target directory

openRepository

Computation<Repository> openRepository(Directory directory)
Returns a new computation for opening a Git repository located at the specified directory.

This is the asynchronous execution of the GitEngine.openRepository(Directory) task.

Parameters:
directory - the directory where a Git repository is located
Returns:
a new computation for opening a Git repository located at the specified directory

readBlob

Computation<Blob> readBlob(Repository repository,
                           ObjectId id)
Returns a new computation for reading a blob object from a repository.

This is the asynchronous execution of the GitEngine.readBlob(Repository, ObjectId) task.

Parameters:
repository - the git repository from which to read the commit
id - the unique hash value of the blob to read
Returns:
a new computation for reading a blob object from a repository

readCommit

Computation<Commit> readCommit(Repository repository,
                               ObjectId id)
Returns a new computation for reading a commit object from a repository.

This is the asynchronous execution of the GitEngine.readCommit(Repository, ObjectId) task.

Parameters:
repository - the git repository from which to read the commit
id - the unique hash value of the commit to read
Returns:
a new computation for reading a commit object from a repository

readTree

Computation<Tree> readTree(Repository repository,
                           ObjectId id)
Returns a new computation for reading a tree object from a repository.

This is the asynchronous execution of the GitEngine.readTree(Repository, ObjectId) task.

Parameters:
repository - the git repository from which to read the tree
id - the unique hash value of the tree to read
Returns:
a new computation for reading a tree object from a repository

resolve

Computation<MaybeObjectId> resolve(Repository repository,
                                   RefName ref)
Returns a new computation for resolving a Git reference.

This is the asynchronous execution of the GitEngine.resolve(Repository, RefName) task.

Parameters:
repository - the repository for which the reference will be resolved
ref - the Git reference to be resolved
Returns:
a new computation for resolving a Git reference

updateRef

Computation<MaybeObjectId> updateRef(Repository repository,
                                     RefName ref,
                                     ObjectId newValue)
Returns a new computation for updating a Git reference.

This is the asynchronous execution of the GitEngine.updateRef(Repository, RefName, ObjectId) task.

Parameters:
repository - the repository for which the reference will be updated
ref - the Git reference to be updated
newValue - the new value for the reference
Returns:
a new computation for updating a Git reference

writeCommit

Computation<ObjectId> writeCommit(Repository repository,
                                  MutableCommit commit)
Returns a new computation for writing a commit object (as a loose object) to a repository.

This is the asynchronous execution of the GitEngine.writeCommit(Repository, MutableCommit) task.

Parameters:
repository - the git repository where the commit is to be written
commit - a MutableCommit instance containing all the information to be recorded as a commit object
Returns:
a new computation for writing a commit object (as a loose object) to a repository

writeTree

Computation<ObjectId> writeTree(GitCommand<?> command,
                                Repository repository,
                                MutableTree tree)
Returns a new computation for recursively writing tree objects to a repository.

This is the asynchronous execution of the GitEngine.writeTree(Repository, MutableTree) task.

Parameters:
command - the requestor of this computation
repository - the git repository where the tree is to be written
tree - a MutableTree to be written
Returns:
a new computation for recursively writing tree objects to a repository


Copyright © 2020–2022 Objectos Software LTDA. All rights reserved.